-
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?
|
Reminder, once the PR becomes ready for a review, use |
…nts for using RwLock with atomic types
…ld be used instead - Added new lints: `RWLOCK_ATOMIC`, `RWLOCK_INTEGER`, `MUTEX_ATOMIC`, and `MUTEX_INTEGER` to check for inappropriate usage of `RwLock` and `Mutex` with atomic types. - Created a new lint pass `SyncGuard` to handle the linting logic for these cases. - Updated tests to cover various scenarios where `RwLock` and `Mutex` are used with atomic types, ensuring that the lints trigger correctly. - Removed outdated test files and added new tests to validate the behavior of the new lints. - Rename rwlock_atomic.rs to rwlock_mutex_atomic.rs
|
Hey @blyxyas I have merged the lints and renamed the lint file and its uibless counterpart. Looking forward to your feedback :3 |
|
@rustbot ready |
changelog: [
rwlock_atomic]: new lintchangelog: [
rwlock_integer]: new lint