about summary refs log tree commit diff
path: root/clippy_lints/src/declared_lints.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-10-26 21:01:40 +0000
committerbors <bors@rust-lang.org>2023-10-26 21:01:40 +0000
commit2f0f4ddcf73a82115168d187a5c2121b413e34a2 (patch)
tree6905d68c743b60b0c4bef06be884084ae9d590e2 /clippy_lints/src/declared_lints.rs
parent392b2552806d2479cf73f519c0825c44c1fde0e3 (diff)
parentebf6667b571568e88e4b8934013515cb69db74e8 (diff)
Auto merge of #11698 - a1phyr:waker_clone_and_wake, r=y21
Add `waker_clone_and_wake` lint to check needless `Waker` clones

Check for patterns of `waker.clone().wake()` and replace them with `waker.wake_by_ref()`.

An alternative name could be `waker_clone_then_wake`

changelog: [ `waker_clone_wake`]: new lint
Diffstat (limited to 'clippy_lints/src/declared_lints.rs')
-rw-r--r--clippy_lints/src/declared_lints.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/clippy_lints/src/declared_lints.rs b/clippy_lints/src/declared_lints.rs
index 558fb658b20..8a341513303 100644
--- a/clippy_lints/src/declared_lints.rs
+++ b/clippy_lints/src/declared_lints.rs
@@ -443,6 +443,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
     crate::methods::USELESS_ASREF_INFO,
     crate::methods::VEC_RESIZE_TO_ZERO_INFO,
     crate::methods::VERBOSE_FILE_READS_INFO,
+    crate::methods::WAKER_CLONE_WAKE_INFO,
     crate::methods::WRONG_SELF_CONVENTION_INFO,
     crate::methods::ZST_OFFSET_INFO,
     crate::min_ident_chars::MIN_IDENT_CHARS_INFO,