Skip to content
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

clippy::use_self has too many false positives #53

Closed
davidpdrsn opened this issue Nov 30, 2020 · 4 comments
Closed

clippy::use_self has too many false positives #53

davidpdrsn opened this issue Nov 30, 2020 · 4 comments
Labels

Comments

@davidpdrsn
Copy link
Contributor

davidpdrsn commented Nov 30, 2020

clippy::use_self was previously part of our default set of clippy lints but we've had to remove it since it lead to false positives where applying its suggestions would fail to compile.

This comment links to some of the issues.

One specific case we've run into is this

#![deny(clippy::use_self)]

pub struct Foo<T> {
    value: T,
}

impl<T> Foo<T> {
    pub fn new<K>(value: K) -> Foo<K> {
                            // ^^^^^^ changing this to `Self` wont work
        Foo { value }
    }
}
@repi
Copy link
Contributor

repi commented Mar 6, 2021

Looks like rust-lang/rust-clippy#4140 is the only remaining filed issue on the use_self lint, so once that has been resolved we may be able to add it back to a new version of our standard lints (#59) which would be nice! Probably not v0.3 though (#60) as that should be within a week or so

@repi
Copy link
Contributor

repi commented Jun 15, 2021

Looks like that clippy issue was fixed now, could you try to see if we have this issue still with latest nightly clippy @davidpdrsn ?

@davidpdrsn
Copy link
Contributor Author

It seems to be working!

@repi
Copy link
Contributor

repi commented Jun 16, 2021

Sweet! May be in Rust 1.54 or so then if it just got into nightly now, so could start using it then

@repi repi closed this as completed Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants