Skip to content

Commit

Permalink
rewrite incr-foreign-head-span to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jul 22, 2024
1 parent 313309d commit 669f6cd
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 23 deletions.
1 change: 1 addition & 0 deletions src/tools/compiletest/src/command-list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"only-wasm32-wasip1",
"only-watchos",
"only-windows",
"only-windows-gnu",
"only-x86",
"only-x86_64",
"only-x86_64-fortanix-unknown-sgx",
Expand Down
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 @@ -31,7 +31,6 @@ run-make/foreign-double-unwind/Makefile
run-make/foreign-exceptions/Makefile
run-make/foreign-rust-exceptions/Makefile
run-make/incr-add-rust-src-component/Makefile
run-make/incr-foreign-head-span/Makefile
run-make/issue-107094/Makefile
run-make/issue-14698/Makefile
run-make/issue-15460/Makefile
Expand Down
21 changes: 0 additions & 21 deletions tests/run-make/incr-foreign-head-span/Makefile

This file was deleted.

25 changes: 25 additions & 0 deletions tests/run-make/incr-foreign-head-span/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Ensure that modifying a crate on disk (without recompiling it)
// does not cause ICEs (internal compiler errors) in downstream crates.
// Previously, we would call `SourceMap.guess_head_span` on a span
// from an external crate, which would cause us to read an upstream
// source file from disk during compilation of a downstream crate.
// See https://github.com/rust-lang/rust/issues/86480

//@ ignore-none
// Reason: no-std is not supported
//@ ignore-nvptx64-nvidia-cuda
// Reason: can't find crate for 'std'

use run_make_support::{rfs, rust_lib_name, rustc};

fn main() {
rustc().input("first_crate.rs").incremental("incr").crate_type("lib").run();
rustc()
.input("second_crate.rs")
.incremental("incr")
.extern_("first_crate", rust_lib_name("first_crate"))
.crate_type("lib")
.run();
rfs::remove_file("first_crate.rs");
rustc().input("second_crate.rs").incremental("incr").cfg("second_run").crate_type("lib").run();
}
4 changes: 3 additions & 1 deletion tests/run-make/interdependent-c-libraries/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
// library will be stripped out, and the linkage will fail.
// See https://github.com/rust-lang/rust/commit/e6072fa0c4c22d62acf3dcb78c8ee260a1368bd7

// FIXME(Oneirical): test-various
//@ ignore-cross-compile
// Reason: linkage still fails as the object files produced are not in the correct
// format in the `build_native_static_lib` step

use run_make_support::{build_native_static_lib, rustc};

Expand Down

0 comments on commit 669f6cd

Please sign in to comment.