Skip to content

Commit

Permalink
Rollup merge of #136923 - samueltardieu:push-vxxqvqwspssv, r=davidtwco
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthiaskrgr authored Feb 19, 2025
2 parents 835e6a6 + 8573725 commit a81c264
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion clippy_lints/src/infinite_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ impl Finiteness {
}

impl From<bool> for Finiteness {
#[must_use]
fn from(b: bool) -> Self {
if b { Infinite } else { Finite }
}
Expand Down
3 changes: 0 additions & 3 deletions clippy_utils/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down

0 comments on commit a81c264

Please sign in to comment.