Skip to content

Commit 37599b2

Browse files
committed
rewrite and rename issue-83112-incr-test-moved-file to rmake
1 parent 9dcaa7f commit 37599b2

File tree

4 files changed

+27
-26
lines changed

4 files changed

+27
-26
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ run-make/issue-36710/Makefile
6262
run-make/issue-47551/Makefile
6363
run-make/issue-69368/Makefile
6464
run-make/issue-83045/Makefile
65-
run-make/issue-83112-incr-test-moved-file/Makefile
6665
run-make/issue-84395-lto-embed-bitcode/Makefile
6766
run-make/issue-85019-moved-src-dir/Makefile
6867
run-make/issue-85401-static-mir/Makefile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// The generated test harness code contains spans with a dummy location,
2+
// but a non-dummy SyntaxContext. Previously, the incremental cache was encoding
3+
// these spans as a full span (with a source file index), instead of skipping
4+
// the encoding of the location information. If the file gest moved, the hash
5+
// of the span will be unchanged (since it has a dummy location), so the incr
6+
// cache would end up try to load a non-existent file using the previously
7+
// enccoded source file id.
8+
// This test reproduces the steps that used to trigger this bug, and checks
9+
// for successful compilation.
10+
// See https://github.com/rust-lang/rust/issues/83112
11+
12+
//@ ignore-none
13+
// Reason: no-std is not supported
14+
//@ ignore-nvptx64-nvidia-cuda
15+
// FIXME: can't find crate for 'std'
16+
17+
use run_make_support::{fs_wrapper, rust_lib_name, rustc};
18+
19+
fn main() {
20+
fs_wrapper::create_dir("incr");
21+
fs_wrapper::create_dir("src");
22+
fs_wrapper::create_dir("src/mydir");
23+
fs_wrapper::copy("main.rs", "src/main.rs");
24+
rustc().input("src/main.rs").incremental("incr").arg("--test").run();
25+
fs_wrapper::rename("src/main.rs", "src/mydir/main.rs");
26+
rustc().input("src/mydir/main.rs").incremental("incr").arg("--test").run();
27+
}

tests/run-make/issue-83112-incr-test-moved-file/Makefile

-25
This file was deleted.

0 commit comments

Comments
 (0)