-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(rwlock_atomic): add new lints for using RwLock with atomic types #16180
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
base: master
Are you sure you want to change the base?
Conversation
changelog: [`rwlock_atomic`]: new lint changelog: [`rwlock_integer`]: new lint
|
Hey @blyxyas, would you be interested in reviewing? |
|
Yes @Tunglies I'll review this one, could you give us some more information in the pull request's description? Is this fixing any existing issues? In general, more context on why this pull request is needed would be very appreciated. Thanks! |
I found Mutex rules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that the lint logic is really similar to mutex_atomic, could you merge these?
| /// On the other hand, `RwLock`s are, in general, easier to | ||
| /// verify correctness. An atomic does not behave the same as | ||
| /// an equivalent RwLock. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this paragraph. Is RwLock supposed to be Atomic here? Could you clarify? ミ๏v๏彡
| /// ``` | ||
| #[clippy::version = "1.93.0"] | ||
| pub RWLOCK_INTEGER, | ||
| restriction, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this lints should be suspicious, what do you think? (=ↀωↀ=)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that these two lints are very very similar to mutex_atomic.rs, could you merge these 4 lints? They same like 90% of the same logic
|
Reminder, once the PR becomes ready for a review, use |
changelog: [
rwlock_atomic]: new lintchangelog: [
rwlock_integer]: new lint