-
Notifications
You must be signed in to change notification settings - Fork 13.3k
unused_qualification removes generic params #113808
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-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
Comments
Minimized and not requiring nightly: #![warn(unused_qualifications)]
mod inner {
pub trait Trait<T> {}
}
// the import needs to be here for the lint to show up
#[allow(unused_imports)]
use inner::Trait;
impl inner::Trait<u8> for () {} |
Thanks for the ping, investigating |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jul 18, 2023
…-suggestion, r=oli-obk Fix removal span calculation of `unused_qualifications` suggestion Given a path such as `std::ops::Index<str>`, calculate the unnecessary qualification removal span by computing the beginning of the entire span until the ident span of the last path segment, which handles generic arguments and lifetime arguments in the last path segment. Previous logic only kept the ident span of the last path segment which is incorrect. Closes rust-lang#113808.
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Jul 18, 2023
…-suggestion, r=oli-obk Fix removal span calculation of `unused_qualifications` suggestion Given a path such as `std::ops::Index<str>`, calculate the unnecessary qualification removal span by computing the beginning of the entire span until the ident span of the last path segment, which handles generic arguments and lifetime arguments in the last path segment. Previous logic only kept the ident span of the last path segment which is incorrect. Closes rust-lang#113808.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jul 18, 2023
…-suggestion, r=oli-obk Fix removal span calculation of `unused_qualifications` suggestion Given a path such as `std::ops::Index<str>`, calculate the unnecessary qualification removal span by computing the beginning of the entire span until the ident span of the last path segment, which handles generic arguments and lifetime arguments in the last path segment. Previous logic only kept the ident span of the last path segment which is incorrect. Closes rust-lang#113808.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
I tried this code:
rustc --force-warn unused-qualifications
Somehow the generic info gets lost completely? :S
The text was updated successfully, but these errors were encountered: