Skip to content

clippy::let_underscore_lock lint should use #[clippy::has_significant_drop] attribute rather than a hardcoded list #8859

Open
@CAD97

Description

@CAD97

Description

#[clippy::has_significant_drop] was added for the lint clippy::significant_drop_in_scrutinee.

The clippy::let_underscore_lock currently uses a hardcoded list of type paths to lint against:

const SYNC_GUARD_PATHS: [&[&str]; 5] = [
&paths::MUTEX_GUARD,
&paths::RWLOCK_READ_GUARD,
&paths::RWLOCK_WRITE_GUARD,
&paths::PARKING_LOT_RAWMUTEX,
&paths::PARKING_LOT_RAWRWLOCK,
];

Instead, it should use the presence of the new #[clippy::has_significant_drop] attribute.

Checking for the parking_lot types by path might need to stay around for a while until most parking_lot consumers are using a version with the #[clippy::has_significant_drop] attribute.

Version

git master

Additional Labels

@rustbot label +C-enhancement +C-an-interesting-project
(I guess)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-an-interesting-projectCategory: Interesting projects, that usually are more involved design/code wise.C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions