-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Lint suggesting crate::
makes overlapping suggestions
#52754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
A-edition-2018
Area: The 2018 edition
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
F-rust_2018_preview
`#![feature(rust_2018_preview)]`
Milestone
Comments
This was referenced Jul 26, 2018
Closed
Carrying over the preview 2 milestone from #51210 |
The impact of this issue can also be mitigated by rust-lang/cargo#5813 |
I'm gonna consider this closed with rust-lang/cargo#5842 as it'll be worked around in Cargo |
alexcrichton
added a commit
to alexcrichton/cargo
that referenced
this issue
Jul 31, 2018
This commit updates the `cargo fix` implementation to iteratively apply fixes from the compiler instead of only once. Currently the compiler can sometimes emit overlapping suggestions, such as in the case of transitioning ::foo::<::Bar>(); to ... crate::foo::<crate::Bar>(); and `rustfix` rightfully can't handle overlapping suggestions as there's no clear way of how to disambiguate the fixes. To fix this problem Cargo will now run `rustc` and `rustfix` multiple times, attempting to reach a steady state where no fixes failed to apply. Naturally this is a pretty tricky thing to do and we want to be sure that Cargo doesn't loop forever, for example. A number of safeguards are in place to prevent Cargo from going off into the weeds when fixing files, notably avoiding to reattempt fixes if no successful fixes ended up being applied. Closes rust-lang#5813 Closes rust-lang/rust#52754
bors
added a commit
to rust-lang/cargo
that referenced
this issue
Aug 1, 2018
fix: Iteratively apply suggestions from the compiler This commit updates the `cargo fix` implementation to iteratively apply fixes from the compiler instead of only once. Currently the compiler can sometimes emit overlapping suggestions, such as in the case of transitioning ::foo::<::Bar>(); to ... crate::foo::<crate::Bar>(); and `rustfix` rightfully can't handle overlapping suggestions as there's no clear way of how to disambiguate the fixes. To fix this problem Cargo will now run `rustc` and `rustfix` multiple times, attempting to reach a steady state where no fixes failed to apply. Naturally this is a pretty tricky thing to do and we want to be sure that Cargo doesn't loop forever, for example. A number of safeguards are in place to prevent Cargo from going off into the weeds when fixing files, notably avoiding to reattempt fixes if no successful fixes ended up being applied. Closes #5813 Closes rust-lang/rust#52754
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-edition-2018
Area: The 2018 edition
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
F-rust_2018_preview
`#![feature(rust_2018_preview)]`
First reported at rust-lang/cargo#5797, this code:
yields these warnings:
unfortunately though, the overlapping suggestions here means that rustfix can't apply a fix!
The text was updated successfully, but these errors were encountered: