Skip to content

Commit d553d5b

Browse files
committed
rewrite incr-prev-body-beyond-eof in rmake
1 parent b4834a1 commit d553d5b

File tree

3 files changed

+32
-20
lines changed

3 files changed

+32
-20
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ run-make/inaccessible-temp-dir/Makefile
7979
run-make/include_bytes_deps/Makefile
8080
run-make/incr-add-rust-src-component/Makefile
8181
run-make/incr-foreign-head-span/Makefile
82-
run-make/incr-prev-body-beyond-eof/Makefile
8382
run-make/incremental-debugger-visualizer/Makefile
8483
run-make/incremental-session-fail/Makefile
8584
run-make/inline-always-many-cgu/Makefile

tests/run-make/incr-prev-body-beyond-eof/Makefile

-19
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// After modifying the span of a function, if the length of
2+
// the span remained the same but the end line number became different,
3+
// this would cause an internal compiler error (ICE), fixed in #76256.
4+
5+
// This test compiles main.rs twice, first with end line 16 and
6+
// then with end line 12. If compilation is successful, the end line
7+
// was hashed by rustc in addition to the span length, and the fix still
8+
// works.
9+
10+
// FIXME: Ignore flags temporarily disabled for the test.
11+
// ignore-none
12+
// ignore-nvptx64-nvidia-cuda
13+
14+
use run_make_support::{rustc, target, tmp_dir};
15+
use std::fs;
16+
17+
fn main() {
18+
fs::create_dir(tmp_dir().join("src"));
19+
fs::create_dir(tmp_dir().join("incr"));
20+
fs::copy("a.rs", tmp_dir().join("main.rs"));
21+
rustc()
22+
.incremental(tmp_dir().join("incr"))
23+
.input(tmp_dir().join("src/main.rs"))
24+
.target(target())
25+
.run();
26+
fs::copy("b.rs", tmp_dir().join("main.rs"));
27+
rustc()
28+
.incremental(tmp_dir().join("incr"))
29+
.input(tmp_dir().join("src/main.rs"))
30+
.target(target())
31+
.run();
32+
}

0 commit comments

Comments
 (0)