Unresolved import error suggests semicolon in list import #103943
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
If there is a list import with
use path::{...};
with a wrong path, Rust is giving wrong suggestions for that path, it suggests a semicolon. E.g. for this code:It prints:
You can't use a semicolon here however, you have to use a comma. Also, it suggests absolute paths, while it should take into account that we are looking for sub-paths of
std::collections
.It should suggest code like:
cc @compiler-errors
@rustbot label A-diagnostics
The text was updated successfully, but these errors were encountered: