Skip to content

Commit

Permalink
rewrite missing-crate-dependency to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jul 17, 2024
1 parent d83ada3 commit 890ef11
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 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 @@ -75,7 +75,6 @@ run-make/macos-deployment-target/Makefile
run-make/macos-fat-archive/Makefile
run-make/manual-link/Makefile
run-make/min-global-align/Makefile
run-make/missing-crate-dependency/Makefile
run-make/native-link-modifier-bundle/Makefile
run-make/native-link-modifier-whole-archive/Makefile
run-make/no-alloc-shim/Makefile
Expand Down
9 changes: 0 additions & 9 deletions tests/run-make/missing-crate-dependency/Makefile

This file was deleted.

17 changes: 17 additions & 0 deletions tests/run-make/missing-crate-dependency/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// A simple smoke test to check that rustc fails compilation
// and outputs a helpful message when a dependency is missing
// in a dependency chain.
// See https://github.com/rust-lang/rust/issues/12146

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

fn main() {
rustc().crate_type("rlib").input("crateA.rs").run();
rustc().crate_type("rlib").input("crateB.rs").run();
fs_wrapper::remove_file(rust_lib_name("crateA"));
// Ensure that crateC fails to compile, as the crateA dependency is missing.
rustc()
.input("crateC.rs")
.run_fail()
.assert_stderr_contains("can't find crate for `crateA` which `crateB` depends on");
}

0 comments on commit 890ef11

Please sign in to comment.