diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index d26d6fe360d..f71992cad23 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -62,7 +62,6 @@ run-make/issue-36710/Makefile run-make/issue-47551/Makefile run-make/issue-69368/Makefile run-make/issue-83045/Makefile -run-make/issue-83112-incr-test-moved-file/Makefile run-make/issue-84395-lto-embed-bitcode/Makefile run-make/issue-85019-moved-src-dir/Makefile run-make/issue-85401-static-mir/Makefile diff --git a/tests/run-make/issue-83112-incr-test-moved-file/main.rs b/tests/run-make/incr-test-moved-file/main.rs similarity index 100% rename from tests/run-make/issue-83112-incr-test-moved-file/main.rs rename to tests/run-make/incr-test-moved-file/main.rs diff --git a/tests/run-make/incr-test-moved-file/rmake.rs b/tests/run-make/incr-test-moved-file/rmake.rs new file mode 100644 index 00000000000..ae142a0d22e --- /dev/null +++ b/tests/run-make/incr-test-moved-file/rmake.rs @@ -0,0 +1,27 @@ +// The generated test harness code contains spans with a dummy location, +// but a non-dummy SyntaxContext. Previously, the incremental cache was encoding +// these spans as a full span (with a source file index), instead of skipping +// the encoding of the location information. If the file gest moved, the hash +// of the span will be unchanged (since it has a dummy location), so the incr +// cache would end up try to load a non-existent file using the previously +// enccoded source file id. +// This test reproduces the steps that used to trigger this bug, and checks +// for successful compilation. +// See https://github.com/rust-lang/rust/issues/83112 + +//@ ignore-none +// Reason: no-std is not supported +//@ ignore-nvptx64-nvidia-cuda +// FIXME: can't find crate for 'std' + +use run_make_support::{fs_wrapper, rust_lib_name, rustc}; + +fn main() { + fs_wrapper::create_dir("incr"); + fs_wrapper::create_dir("src"); + fs_wrapper::create_dir("src/mydir"); + fs_wrapper::copy("main.rs", "src/main.rs"); + rustc().input("src/main.rs").incremental("incr").arg("--test").run(); + fs_wrapper::rename("src/main.rs", "src/mydir/main.rs"); + rustc().input("src/mydir/main.rs").incremental("incr").arg("--test").run(); +} diff --git a/tests/run-make/issue-83112-incr-test-moved-file/Makefile b/tests/run-make/issue-83112-incr-test-moved-file/Makefile deleted file mode 100644 index a00088cd9d6..00000000000 --- a/tests/run-make/issue-83112-incr-test-moved-file/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -include ../tools.mk - -# ignore-none no-std is not supported -# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for 'std' - -# Regression test for issue #83112 -# The generated test harness code contains spans with a dummy location, -# but a non-dummy SyntaxContext. Previously, the incremental cache was encoding -# these spans as a full span (with a source file index), instead of skipping -# the encoding of the location information. If the file gest moved, the hash -# of the span will be unchanged (since it has a dummy location), so the incr -# cache would end up try to load a non-existent file using the previously -# enccoded source file id. - -SRC=$(TMPDIR)/src -INCR=$(TMPDIR)/incr - -all: - mkdir $(SRC) - mkdir $(SRC)/mydir - mkdir $(INCR) - cp main.rs $(SRC)/main.rs - $(RUSTC) --test -C incremental=$(INCR) $(SRC)/main.rs --target $(TARGET) - mv $(SRC)/main.rs $(SRC)/mydir/main.rs - $(RUSTC) --test -C incremental=$(INCR) $(SRC)/mydir/main.rs --target $(TARGET)