Skip to content

Unable to allow unused_self after enabling pedantic #5053

Closed
@martinthomson

Description

@martinthomson

This code:

#![deny(warnings)]
#![warn(clippy::pedantic)]

struct X {}
impl X {
    #[allow(clippy::unused_self, clippy::cast_possible_truncation)]
    fn test(&self, a: u32) {
        println!("testing {}", a as u16);
    }
}
pub fn main() {
    let x = X {};
    x.test(1);
}

This correctly suppresses the clippy::cast_possible_truncation warning, but fails to suppress the clippy::unused_self.

The rust playground is currently at 0.0.212 (2019-12-29 c807fbc).
The same error is produced by clippy 0.0.212 (c8e3cfb 2019-10-28).
Older versions I have access to, such as clippy 0.0.212 (4e7e71b 2019-10-11) don't have this lint, so it's hard to pin down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions