Skip to content

Commit 7dd5e3c

Browse files
committed
Add regression test for resolving --extern libc=test.rlib
I could not find a test for this particular use case. The closest I got was `tests/ui/imports/issue-37887.rs`, but that is a regression test for a different use case.
1 parent a6236fa commit 7dd5e3c

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Regression test for https://github.com/rust-lang/rust/issues/26043
2+
3+
// compile-flags: --extern libc=test.rlib
4+
5+
// The error shall NOT be something similar to the following, because it
6+
// indicates that `libc` was wrongly resolved to `libc` shipped with the
7+
// compiler:
8+
//
9+
// error[E0658]: use of unstable library feature 'rustc_private': \
10+
// this crate is being loaded from the sysroot
11+
//
12+
extern crate libc; //~ ERROR: extern location for libc does not exist: test.rlib
13+
14+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: extern location for libc does not exist: test.rlib
2+
--> $DIR/resolve-other-libc.rs:12:1
3+
|
4+
LL | extern crate libc;
5+
| ^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)