[non_canonical_partial_ord_impl]: Fix emitting warnings which conflict with needless_return
This commit is contained in:
parent
c642d0cab6
commit
107e44b76f
3 changed files with 71 additions and 11 deletions
|
|
@ -142,3 +142,21 @@ impl PartialOrd for H {
|
|||
Some(Ord::cmp(self, other))
|
||||
}
|
||||
}
|
||||
|
||||
// #12683, do not lint
|
||||
|
||||
#[derive(Eq, PartialEq)]
|
||||
struct I(u32);
|
||||
|
||||
impl Ord for I {
|
||||
fn cmp(&self, other: &Self) -> Ordering {
|
||||
todo!();
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialOrd for I {
|
||||
#[allow(clippy::needless_return)]
|
||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||
return Some(self.cmp(other));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,3 +146,21 @@ impl PartialOrd for H {
|
|||
Some(Ord::cmp(self, other))
|
||||
}
|
||||
}
|
||||
|
||||
// #12683, do not lint
|
||||
|
||||
#[derive(Eq, PartialEq)]
|
||||
struct I(u32);
|
||||
|
||||
impl Ord for I {
|
||||
fn cmp(&self, other: &Self) -> Ordering {
|
||||
todo!();
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialOrd for I {
|
||||
#[allow(clippy::needless_return)]
|
||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||
return Some(self.cmp(other));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue