Skip to content

Commit f768db6

Browse files
committed
rewrite and rename issue-83045 to rmake
1 parent 05eac57 commit f768db6

File tree

5 files changed

+39
-33
lines changed

5 files changed

+39
-33
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// This test case creates a situation where the crate loader would run
2+
// into an ICE (internal compiler error) when confronted with an invalid setup where it cannot
3+
// find the dependency of a direct dependency.
4+
//
5+
// The test case makes sure that the compiler produces the expected
6+
// error message but does not ICE immediately after.
7+
//
8+
// See https://github.com/rust-lang/rust/issues/83045
9+
10+
//@ only-x86_64
11+
//@ only-linux
12+
// Reason: This is a platform-independent issue, no need to waste time testing
13+
// everywhere.
14+
15+
// NOTE: We use `bare_rustc` below so that the compiler can't find liba.rlib
16+
// If we used `rustc` the additional '-L rmake_out' option would allow rustc to
17+
// actually find the crate.
18+
19+
use run_make_support::{bare_rustc, fs_wrapper, rust_lib_name, rustc};
20+
21+
fn main() {
22+
rustc().crate_name("a").crate_type("rlib").input("a.rs").arg("--verbose").run();
23+
rustc()
24+
.crate_name("b")
25+
.crate_type("rlib")
26+
.extern_("a", rust_lib_name("a"))
27+
.input("b.rs")
28+
.arg("--verbose")
29+
.run();
30+
fs_wrapper::create_dir("wrong_directory");
31+
bare_rustc()
32+
.extern_("b", rust_lib_name("b"))
33+
.crate_type("rlib")
34+
.edition("2018")
35+
.input("c.rs")
36+
.run_fail()
37+
.assert_stderr_contains("E0463")
38+
.assert_stderr_not_contains("internal compiler error");
39+
}

tests/run-make/issue-83045/Makefile

-33
This file was deleted.

0 commit comments

Comments
 (0)