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

Mark MutexGuard with #[clippy::has_significant_drop] #369

Merged
merged 2 commits into from Feb 3, 2023

Conversation

c410-f3r
Copy link
Contributor

@c410-f3r c410-f3r commented Feb 2, 2023

#[clippy::has_significant_drop] tells that a structure should be considered when evaluating some lints. Examples of such behavior are the existent clippy::significant_drop_in_scrutinee and the soon-to-be-finished rust-lang/rust-clippy#9399.

`#[clippy::has_significant_drop]` tells that a structure should be considered when evaluating some lints. Examples of such behavior are the existent `clippy::significant_drop_in_scrutinee` and in the soon-to-be-finished rust-lang/rust-clippy#9399.
lock_api/src/mutex.rs Outdated Show resolved Hide resolved
@Amanieu Amanieu merged commit 56b91e9 into Amanieu:master Feb 3, 2023
@mkroening
Copy link
Contributor

@c410-f3r, should we also apply this to all the other guards, like the RwLock guards and the reentrant mutex guard, as well as their mapped variants?

@c410-f3r
Copy link
Contributor Author

c410-f3r commented Mar 7, 2023

Yes, any lock primitive should apply #[clippy::has_significant_drop] in order to trigger the two mentioned lints.

Moreover, it is very likely that other lints will also use #[clippy::has_significant_drop] in the future.

@mkroening
Copy link
Contributor

I opened #371.

@c410-f3r
Copy link
Contributor Author

c410-f3r commented Mar 7, 2023

Nice! Thank you

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.

None yet

3 participants