impl manual_noop_waker lint#16687
Conversation
|
r? @dswij rustbot has assigned @dswij. Use Why was this reviewer chosen?The reviewer was selected based on:
|
9ff1a2c to
a64fe9c
Compare
|
Reminder, once the PR becomes ready for a review, use |
It's not vibe coded. I followed example and on that I'll do implementation. It's my first pr in this repo. |
31dfdc6 to
9e5f983
Compare
|
@rustbot ready |
There was a problem hiding this comment.
You haven't addressed the false positives (see #16687 (review))
Did you see? |
|
@rustbot ready |
|
@rustbot ready |
2e3401f to
78a359e
Compare
78a359e to
26740ea
Compare
|
@rustbot ready |
|
Thanks. |
View all comments
Fixes #16639
Description
This PR introduces a new lint manual_noop_waker that detects manual, empty implementations of the std::task::Wake trait. These can be replaced with std::task::Waker::noop(), which is more performant (avoids Arc allocation) and cleaner.
Example
Can be replaced with:
I've followed the contribution guidelines
I've added UI tests for the new lint
I've run
cargo dev update_lintschangelog:
[manual_noop_waker]: Added a lint to detect manual no-op Wake implementations.