-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
rustc often offers a help to import something from std and core:
error[E0433]: failed to resolve: use of undeclared type `NonZeroU32`
--> ...\test.rs:20:33
|
20 | ... NonZeroU32::new(5).unwrap(),
| ^^^^^^^^^^ not found in this scope
|
help: consider importing one of these items
|
6 | use core::num::NonZeroU32;
|
6 | use std::num::NonZeroU32;
|
Perhaps in such situations rustc could use an heuristic to suggest only one of the two imports.
workingjubilee, FliegendeWurst, SkiFire13, ssbr and Kobzol
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.