-
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-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.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
use std::sync::atomic;
fn main() {
NonZeroU8::new(1);
}
error[E0433]: failed to resolve: use of undeclared type `NonZeroU8`
--> src/main.rs:4:5
|
4 | NonZeroU8::new(1);
| ^^^^^^^^^ not found in this scope
|
help: consider importing one of these items
|
1 | use core::num::NonZeroU8;
|
1 | use crate::atomic::fmt::str::iter::option::convert::num::NonZeroU8;
The suggested import path, crate::atomic::fmt::str::iter::option::convert::num::NonZeroU8
, goes through private imports (so it doesn't work), and is also ridiculously long. These suggestions might want to take inspiration from rust-analyzer and only display the shortest path(s) to any candidate (and also should not include private imports).
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.Category: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.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.