diff --git a/tests/ui/imports/resolve-other-libc.rs b/tests/ui/imports/resolve-other-libc.rs new file mode 100644 index 0000000000000..806d854ec8906 --- /dev/null +++ b/tests/ui/imports/resolve-other-libc.rs @@ -0,0 +1,14 @@ +// Regression test for https://github.com/rust-lang/rust/issues/26043 + +// compile-flags: --extern libc=test.rlib + +// The error shall NOT be something similar to the following, because it +// indicates that `libc` was wrongly resolved to `libc` shipped with the +// compiler: +// +// error[E0658]: use of unstable library feature 'rustc_private': \ +// this crate is being loaded from the sysroot +// +extern crate libc; //~ ERROR: extern location for libc does not exist: test.rlib + +fn main() {} diff --git a/tests/ui/imports/resolve-other-libc.stderr b/tests/ui/imports/resolve-other-libc.stderr new file mode 100644 index 0000000000000..e57b88e50c639 --- /dev/null +++ b/tests/ui/imports/resolve-other-libc.stderr @@ -0,0 +1,8 @@ +error: extern location for libc does not exist: test.rlib + --> $DIR/resolve-other-libc.rs:12:1 + | +LL | extern crate libc; + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error +