Closed
Description
// test.rs
extern crate libc;
fn main(){}
is the only file in a directory. rustc
when invoked like this:
$ rustc test.rs --extern libc=test.rlib
test.rs:1:1: 1:19 error: use of unstable library feature 'libc': use `libc` from crates.io
test.rs:1 extern crate libc;
^~~~~~~~~~~~~~~~~~
test.rs:1:1: 1:19 help: add #![feature(libc)] to the crate attributes to enable
error: aborting due to previous error
will still resolve libc to its own liblibc copy rather than fail, as testified by these logs:
…
INFO:rustc::metadata::loader: lib candidate: /usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-11582ce5.rlib
INFO:rustc::metadata::loader: rlib reading metadata from: /usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-11582ce5.rlib
INFO:rustc::metadata::loader: reading "liblibc-11582ce5.rlib" => 13582ns
…
It should fail with a hard error instead, as if the copy shipped with rustc didn’t exist:
$ rustc test.rs --extern libc2=test.rlib
error: extern location for libc2 does not exist: test.rlib