-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Wrong highlighting in E0432 when import and suggestion share prefix #148070
Copy link
Copy link
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-bugCategory: This is a bug.Category: This is a bug.D-imprecise-spansDiagnostics: spans don't point to exactly the erroneous codeDiagnostics: spans don't point to exactly the erroneous codeT-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.
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-bugCategory: This is a bug.Category: This is a bug.D-imprecise-spansDiagnostics: spans don't point to exactly the erroneous codeDiagnostics: spans don't point to exactly the erroneous codeT-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
I expected to see this:
Instead, this happened:
Note that in the second case, the highlighted part is
td::sinstead ofstd::.The error is that as
std::starts with the same prefix assync, it fails to highlight correctly what to add. It's not wrong, as if you add that it works, but it looks weird.The same happens with
timeif you havetokioortracing_suscriberas a dependency.Meta
rustc --version --verbose:This happens up until the last nightly compiler, and happens since it was added.
I could narrow the error, and I tried a fix in #148061 but it makes tests fail, as other warnings depend on this behaviour.