Better diagnostics for error: can't find crate for ... [E0463]

a2ba5f7
Opened by Zoxc at 2019-09-22 14:39:06

It would be nice if rustc would print the search directory for a crate and rejected crates (with matching names) in those directories when it cannot find the crate.

  1. The debug! macros here should be changed to info! so rustc doesn't have to be recompiled for detailed information.

    Zoxc at 2016-04-01 05:34:21

  2. Related: I got this error as the result of trying to compile from a corrupted installation (rustup ran out of space but didn't raise any errors). In particular, rustc reported can't find crate for `core` which `std` depends on. In this case, ~/rustup/toolchains/[target]/lib/rustlib/[target]/lib/libcore*.rlib was present, but its size was zero (so the logical debugging strategy of checking the file paths and sysroot didn't reveal the problem). Running with debugging reported "File too small to be an archive" for libcore. It might be nice to report "can't find" and "found but obviously corrupted" as different errors.

    Jackson Warley at 2018-02-05 20:38:35

  3. Triage: not aware of any better diagnostic here yet!

    Steve Klabnik at 2019-09-22 14:39:06