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

allow(ptr_arg) in argument position #5644

Closed
schatzmeister opened this issue May 25, 2020 · 0 comments · Fixed by #5647
Closed

allow(ptr_arg) in argument position #5644

schatzmeister opened this issue May 25, 2020 · 0 comments · Fixed by #5647
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages E-hard Call for participation: This a hard problem and requires more experience or effort to work on

Comments

@schatzmeister
Copy link

Clippy messages for ptr_arg aren’t disabled when the allow attribute is directly on the argument:

fn foo(
    // Clippy still warns here:
    #[allow(clippy::ptr_arg)] 
    arg: &Vec<u16>,
) {
    // ...
}

Putting it to the top of the function instead works fine:

// Everything works
#[allow(clippy::ptr_arg)] 
fn foo(arg: &Vec<u16>) {
    // ...
}

I think this should be allowed, since it works with other lints.

Link to playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b33ea40fad2a66997225dd21f858230a

@flip1995 flip1995 added E-hard Call for participation: This a hard problem and requires more experience or effort to work on C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages labels May 25, 2020
@bors bors closed this as completed in 2a6cfa7 May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages E-hard Call for participation: This a hard problem and requires more experience or effort to work on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants