Description
The current implementation uses --extern
flags to tell rustc
where the standard library dependencies are located. This runs into a few problems when a user attempts to use extern crate
for a crate that was not included. For example, a no_std
crate that has extern std
, or an extern crate test
when libtest is not built. These will attempt to load from the default sysroot which causes a huge number of inscrutable errors.
It may be nice to tell rustc
to not look in the pre-built sysroot to avoid this problem (and will result in a nicer "crate not found" error). This can be done with --sysroot=nonexistent
or an empty directory. Alternatively, we can add a new flag to rustc
to disable the sysroot search.
This may have complications, since the sysroot is used for more than rlib dependencies. For example, it is also used for bundled things (like linkers? bundled crt objects?).
Beware this may affect things like clippy-driver, rustdoc, etc.