Improve unresolved use error message "use of undeclared type or module `foo`" doesn't mention that it could be a crate. This error can happen when users forget to add a dependency to `Cargo.toml`, so I think it's important to mention that it could be a missing crate. I've used a heuristic based on Rust's naming conventions. It complains about an unknown type if the ident starts with an upper-case letter, and crate or module otherwise. It seems to work very well. The expanded error help covers both an unknown type and a missing crate case. |
||
|---|---|---|
| .. | ||
| auxiliary | ||
| use-mod | ||
| issue-18986.rs | ||
| issue-18986.stderr | ||
| issue-60976-extern-use-primitive-type.rs | ||
| use-after-move-based-on-type.rs | ||
| use-after-move-based-on-type.stderr | ||
| use-after-move-implicity-coerced-object.rs | ||
| use-after-move-implicity-coerced-object.stderr | ||
| use-after-move-self-based-on-type.rs | ||
| use-after-move-self-based-on-type.stderr | ||
| use-after-move-self.rs | ||
| use-after-move-self.stderr | ||
| use-associated-const.rs | ||
| use-associated-const.stderr | ||
| use-from-trait-xc.rs | ||
| use-from-trait-xc.stderr | ||
| use-from-trait.rs | ||
| use-from-trait.stderr | ||
| use-keyword.rs | ||
| use-keyword.stderr | ||
| use-meta-mismatch.rs | ||
| use-meta-mismatch.stderr | ||
| use-mod.rs | ||
| use-mod.stderr | ||
| use-nested-groups-error.rs | ||
| use-nested-groups-error.stderr | ||
| use-nested-groups-unused-imports.rs | ||
| use-nested-groups-unused-imports.stderr | ||
| use-paths-as-items.rs | ||
| use-paths-as-items.stderr | ||
| use-self-type.rs | ||
| use-self-type.stderr | ||
| use-super-global-path.rs | ||
| use-super-global-path.stderr | ||