Skip to content

Commit b6b975d

Browse files
committed
rewrite incr-foreign-head-span to rmake
1 parent 313309d commit b6b975d

File tree

4 files changed

+26
-22
lines changed

4 files changed

+26
-22
lines changed

src/tools/compiletest/src/command-list.rs

+1
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
201201
"only-wasm32-wasip1",
202202
"only-watchos",
203203
"only-windows",
204+
"only-windows-gnu",
204205
"only-x86",
205206
"only-x86_64",
206207
"only-x86_64-fortanix-unknown-sgx",

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ run-make/foreign-double-unwind/Makefile
3131
run-make/foreign-exceptions/Makefile
3232
run-make/foreign-rust-exceptions/Makefile
3333
run-make/incr-add-rust-src-component/Makefile
34-
run-make/incr-foreign-head-span/Makefile
3534
run-make/issue-107094/Makefile
3635
run-make/issue-14698/Makefile
3736
run-make/issue-15460/Makefile

tests/run-make/incr-foreign-head-span/Makefile

-21
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Ensure that modifying a crate on disk (without recompiling it)
2+
// does not cause ICEs (internal compiler errors) in downstream crates.
3+
// Previously, we would call `SourceMap.guess_head_span` on a span
4+
// from an external crate, which would cause us to read an upstream
5+
// source file from disk during compilation of a downstream crate.
6+
// See https://github.com/rust-lang/rust/issues/86480
7+
8+
//@ ignore-none
9+
// Reason: no-std is not supported
10+
//@ ignore-nvptx64-nvidia-cuda
11+
// Reason: can't find crate for 'std'
12+
13+
use run_make_support::{rfs, rust_lib_name, rustc};
14+
15+
fn main() {
16+
rustc().input("first_crate.rs").incremental("incr").crate_type("lib").run();
17+
rustc()
18+
.input("second_crate.rs")
19+
.incremental("incr")
20+
.extern_("first_crate", rust_lib_name("first_crate"))
21+
.crate_type("lib")
22+
.run();
23+
rfs::remove_file("first_crate.rs");
24+
rustc().input("second_crate.rs").incremental("incr").cfg("second_run").crate_type("lib").run();
25+
}

0 commit comments

Comments
 (0)