suggestion/fix (use ::item
) is incorrect for editions 2018+
#141082
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-resolve
Area: Name/path resolution done by `rustc_resolve` specifically
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.
Code
Current output
Desired output
Rationale and extra context
use ::nu
only works in the 2015 edition.use crate::nu
works in the 2015 and newer editionsOther cases
Rust Version
Anything else?
Found this issue while running a compiler UI test on the 2018 edition.
As the UI test has the
run-rustfix
directive, it will use therustfix
crate to apply the suggestions in the compiler output. As the suggestion is wrong for edition 2018+, the output ofrustfix
does not compile as indicate the output of thex
command.What I found curious there is that the JSON version of the diagnostic indicates that the suggestion "may be incorrect", yet
rustfix
(as invoked by thecompiletest
tool) still applies the "maybe incorrect" suggestion.The text was updated successfully, but these errors were encountered: