warn on mod lib;
in main.rs, etc
#4273
Labels
A-diagnostics
Area: Error and warning messages generated by Cargo itself.
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
When a crate imports a module that cargo is also compiling as its own crate root, things can get hairy. The UX can be pretty terrible as in this case:
OK, the error says I need to import
lazy_static
intolib.rs
. Let's do that:WTF! I left the crate out, got an error, I put it in, got an error saying to take it back out. Rust is such a crazy language, OMG!
Of course the second error comes from a totally separate
rustc
run, but there's next to no indication of that. But it seems like we should be able to detect this situation and tell the user what's going on.The text was updated successfully, but these errors were encountered: