-
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-bugCategory: This is a bug.Category: This is a bug.
Description
rust/src/librustc_resolve/lib.rs
Lines 3703 to 3706 in 44990e5
if let Ok(snippet) = cm.span_to_snippet(binding.span) { | |
err.span_suggestion(binding.span, | |
rename_msg, | |
format!("{} as Other{}", snippet, name)); |
Trying to re-import std
or any other crate, I get a suggestion like this:
14 | extern crate std;
| ^^^^^^^^^^^^^^^^^ `std` reimported here
|
= note: `std` must be defined only once in the type namespace of this module
help: You can use `as` to change the binding name of the import
|
14 | extern crate std; as Otherstd
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The problem is in the formatting of the suggestion, where SEMICOLON (;
) is placed before the as
keyword, like this extern crate std; as Otherstd
instead of extern crate std as Otherstd;
.
The suggestion doesn't exist in stable or beta, so this affects only nightly at the moment.
Original commit: ff83240
Original PR: #45660
/cc @Cldfire
Cldfire and estebank
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.