2024-06-25 13:45:49 -05:00
|
|
|
// When a fake library was given to the compiler, it would
|
|
|
|
// result in an obscure and unhelpful error message. This test
|
|
|
|
// creates a false "foo" dylib, and checks that the standard error
|
|
|
|
// explains that the file exists, but that its metadata is incorrect.
|
|
|
|
// See https://github.com/rust-lang/rust/pull/88368
|
|
|
|
|
2024-07-17 08:31:38 -05:00
|
|
|
use run_make_support::{dynamic_lib_name, rfs, rustc};
|
2024-06-25 13:45:49 -05:00
|
|
|
|
|
|
|
fn main() {
|
2024-07-17 07:42:06 -05:00
|
|
|
rfs::create_file(dynamic_lib_name("foo"));
|
2024-06-25 13:45:49 -05:00
|
|
|
rustc()
|
|
|
|
.crate_type("lib")
|
|
|
|
.extern_("foo", dynamic_lib_name("foo"))
|
|
|
|
.input("bar.rs")
|
|
|
|
.run_fail()
|
|
|
|
.assert_stderr_contains("invalid metadata files for crate `foo`");
|
|
|
|
}
|