about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-02-19 21:16:11 +0100
committerGitHub <noreply@github.com>2025-02-19 21:16:11 +0100
commita81c2648dc5e3bc190ebdc9c8fd32c7998001b44 (patch)
tree07733abbf3ee8f5398db4f746f493b09a3c31532
parent835e6a694b543af769c84a99659505b2418d640e (diff)
parent8573725a030a8e17b1f687061f46822234e21cb1 (diff)
downloadrust-a81c2648dc5e3bc190ebdc9c8fd32c7998001b44.tar.gz
rust-a81c2648dc5e3bc190ebdc9c8fd32c7998001b44.zip
Rollup merge of #136923 - samueltardieu:push-vxxqvqwspssv, r=davidtwco
Lint `#[must_use]` attributes applied to methods in trait impls

The `#[must_use]` attribute has no effect when applied to methods in trait implementations. This PR adds it to the unused `#[must_use]` lint, and cleans the extra attributes in portable-simd and Clippy.
-rw-r--r--clippy_lints/src/infinite_iter.rs1
-rw-r--r--clippy_utils/src/consts.rs3
2 files changed, 0 insertions, 4 deletions
diff --git a/clippy_lints/src/infinite_iter.rs b/clippy_lints/src/infinite_iter.rs
index 3cb47d8ef91..960b9aa032b 100644
--- a/clippy_lints/src/infinite_iter.rs
+++ b/clippy_lints/src/infinite_iter.rs
@@ -94,7 +94,6 @@ impl Finiteness {
 }
 
 impl From<bool> for Finiteness {
-    #[must_use]
     fn from(b: bool) -> Self {
         if b { Infinite } else { Finite }
     }
diff --git a/clippy_utils/src/consts.rs b/clippy_utils/src/consts.rs
index 4f707e34abf..dd149c4a29b 100644
--- a/clippy_utils/src/consts.rs
+++ b/clippy_utils/src/consts.rs
@@ -351,21 +351,18 @@ pub enum FullInt {
 }
 
 impl PartialEq for FullInt {
-    #[must_use]
     fn eq(&self, other: &Self) -> bool {
         self.cmp(other) == Ordering::Equal
     }
 }
 
 impl PartialOrd for FullInt {
-    #[must_use]
     fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
         Some(self.cmp(other))
     }
 }
 
 impl Ord for FullInt {
-    #[must_use]
     fn cmp(&self, other: &Self) -> Ordering {
         use FullInt::{S, U};