Skip to content

Commit

Permalink
rewrite incr-prev-body-beyond-eof in rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed May 28, 2024
1 parent b4834a1 commit d553d5b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ run-make/inaccessible-temp-dir/Makefile
run-make/include_bytes_deps/Makefile
run-make/incr-add-rust-src-component/Makefile
run-make/incr-foreign-head-span/Makefile
run-make/incr-prev-body-beyond-eof/Makefile
run-make/incremental-debugger-visualizer/Makefile
run-make/incremental-session-fail/Makefile
run-make/inline-always-many-cgu/Makefile
Expand Down
19 changes: 0 additions & 19 deletions tests/run-make/incr-prev-body-beyond-eof/Makefile

This file was deleted.

32 changes: 32 additions & 0 deletions tests/run-make/incr-prev-body-beyond-eof/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// After modifying the span of a function, if the length of
// the span remained the same but the end line number became different,
// this would cause an internal compiler error (ICE), fixed in #76256.

// This test compiles main.rs twice, first with end line 16 and
// then with end line 12. If compilation is successful, the end line
// was hashed by rustc in addition to the span length, and the fix still
// works.

// FIXME: Ignore flags temporarily disabled for the test.
// ignore-none
// ignore-nvptx64-nvidia-cuda

use run_make_support::{rustc, target, tmp_dir};
use std::fs;

fn main() {
fs::create_dir(tmp_dir().join("src"));
fs::create_dir(tmp_dir().join("incr"));
fs::copy("a.rs", tmp_dir().join("main.rs"));
rustc()
.incremental(tmp_dir().join("incr"))
.input(tmp_dir().join("src/main.rs"))
.target(target())
.run();
fs::copy("b.rs", tmp_dir().join("main.rs"));
rustc()
.incremental(tmp_dir().join("incr"))
.input(tmp_dir().join("src/main.rs"))
.target(target())
.run();
}

0 comments on commit d553d5b

Please sign in to comment.