Skip to content

Commit 85dbe02

Browse files
committed
rewrite missing-crate-dependency to rmake
1 parent 869dd2a commit 85dbe02

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ run-make/macos-deployment-target/Makefile
7878
run-make/macos-fat-archive/Makefile
7979
run-make/manual-link/Makefile
8080
run-make/min-global-align/Makefile
81-
run-make/missing-crate-dependency/Makefile
8281
run-make/mixing-libs/Makefile
8382
run-make/native-link-modifier-bundle/Makefile
8483
run-make/native-link-modifier-whole-archive/Makefile

tests/run-make/missing-crate-dependency/Makefile

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// A simple smoke test to check that rustc fails compilation
2+
// and outputs a helpful message when a dependency is missing
3+
// in a dependency chain.
4+
// See https://github.com/rust-lang/rust/issues/12146
5+
6+
use run_make_support::{fs_wrapper, rust_lib_name, rustc};
7+
8+
fn main() {
9+
rustc().crate_type("rlib").input("crateA.rs").run();
10+
rustc().crate_type("rlib").input("crateB.rs").run();
11+
fs_wrapper::remove_file(rust_lib_name("crateA"));
12+
// Ensure that crateC fails to compile, as the crateA dependency is missing.
13+
rustc()
14+
.input("crateC.rs")
15+
.run_fail()
16+
.assert_stderr_contains("can't find crate for `crateA` which `crateB` depends on");
17+
}

0 commit comments

Comments
 (0)