-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-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
The span for the new use
suggestion (added in #102876) does not include the semicolon, but the suggestion includes a semicolon.
Example:
use std::sync::AtomicU32;
Suggests:
error[E0432]: unresolved import `std::sync::AtomicU32`
--> src/lib.rs:1:5
|
1 | use std::sync::AtomicU32;
| ^^^^^^^^^^^^^^^^^^^^ no `AtomicU32` in `sync`
|
help: consider importing this struct instead
|
1 | use std::sync::atomic::AtomicU32;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
which if applied results in:
use std::sync::atomic::AtomicU32;
;
which won't compile due to the extra semicolon.
I'm not sure if the span needs to be extended, or if the suggestion should just avoid adding the semicolon.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-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.