-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite incr-prev-body-beyond-eof in rmake
- Loading branch information
Showing
3 changed files
with
32 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |