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

Downgrade needless_pass_by_value to pedantic #3439

Merged
merged 1 commit into from
Nov 24, 2018
Merged

Downgrade needless_pass_by_value to pedantic #3439

merged 1 commit into from
Nov 24, 2018

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Nov 21, 2018

I noticed that I suppress this lint in many of my projects.

https://github.com/search?q=needless_pass_by_value+user%3Adtolnay+user%3Aserde-rs&type=Code

Upon further inspection, this lint has a long history of false positives:

And several false positives outstanding:

Generally I feel that this lint is the definition of pedantic and should not be linted by default.

#[derive(Debug)]
enum How {
    ThisWay,
    ThatWay,
}

// Are we really better off forcing the call sites to write f(&_)...?
fn f(how: How) {
    println!("You want to do it {:?}", how);
}

fn main() {
    f(How::ThatWay);
}

@birkenfeld @mitsuhiko

changelog: Remove needless_pass_by_value from default set of enabled lints

@mitsuhiko
Copy link
Contributor

I'm very much in favour of this. Can we have this @birkenfeld? :)

I noticed that I suppress this lint in many of my projects.

https://github.com/search?q=needless_pass_by_value+user%3Adtolnay&type=Code
https://github.com/search?q=needless_pass_by_value+user%3Aserde-rs&type=Code

Upon further inspection, this lint has a *long* history of false
positives (and several remaining).

Generally I feel that this lint is the definition of pedantic and should
not be linted by default.

    #[derive(Debug)]
    enum How {
        ThisWay,
        ThatWay,
    }

    // Are we really better off forcing the call sites to write f(&_)...?
    fn f(how: How) {
        println!("You want to do it {:?}", how);
    }

    fn main() {
        f(How::ThatWay);
    }
@dtolnay
Copy link
Member Author

dtolnay commented Nov 21, 2018

AppVeyor failure appears unrelated.

@oli-obk
Copy link
Contributor

oli-obk commented Nov 22, 2018

Restarting appveyor

@dtolnay
Copy link
Member Author

dtolnay commented Nov 24, 2018

@oli-obk I clicked the "Re-build PR" button in AppVeyor and it built successfully:
https://ci.appveyor.com/project/rust-lang-libs/rust-clippy/builds/20521715

@oli-obk oli-obk merged commit 69d09fb into rust-lang:master Nov 24, 2018
@dtolnay dtolnay deleted the npbv branch November 24, 2018 09:17
@dtolnay dtolnay changed the title Downgrade needless_pass_by_value to allow by default Downgrade needless_pass_by_value to pedantic Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants