Skip to content

Commit ddda3fa

Browse files
authored
Rollup merge of rust-lang#114166 - Enselic:libc-unavailable, r=Nilstrieb
Add regression test for resolving `--extern libc=test.rlib` Closes rust-lang#26043 I could not find a test for this particular use case. The closest I got was [`tests/ui/imports/issue-37887.rs`](https://github.com/rust-lang/rust/blob/master/tests/ui/imports/issue-37887.rs), but that is a regression test for a different use case (see rust-lang#37887).
2 parents 46f6b05 + 7dd5e3c commit ddda3fa

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)