Skip to content

Commit 85d6768

Browse files
committed
clippy fix: bound in one place
1 parent cc0515a commit 85d6768

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

library/core/src/cmp.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,14 +1481,11 @@ pub trait PartialOrd<Rhs: PointeeSized = Self>: PartialEq<Rhs> + PointeeSized {
14811481
}
14821482
}
14831483

1484-
fn default_chaining_impl<T: PointeeSized, U: PointeeSized>(
1484+
fn default_chaining_impl<T: PartialOrd<U> + PointeeSized, U: PointeeSized>(
14851485
lhs: &T,
14861486
rhs: &U,
14871487
p: impl FnOnce(Ordering) -> bool,
1488-
) -> ControlFlow<bool>
1489-
where
1490-
T: PartialOrd<U>,
1491-
{
1488+
) -> ControlFlow<bool> {
14921489
// It's important that this only call `partial_cmp` once, not call `eq` then
14931490
// one of the relational operators. We don't want to `bcmp`-then-`memcp` a
14941491
// `String`, for example, or similarly for other data structures (#108157).

library/core/src/iter/traits/iterator.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3414,10 +3414,9 @@ pub trait Iterator {
34143414
/// ```
34153415
#[stable(feature = "iter_copied", since = "1.36.0")]
34163416
#[rustc_diagnostic_item = "iter_copied"]
3417-
fn copied<'a, T: 'a>(self) -> Copied<Self>
3417+
fn copied<'a, T: Copy + 'a>(self) -> Copied<Self>
34183418
where
34193419
Self: Sized + Iterator<Item = &'a T>,
3420-
T: Copy,
34213420
{
34223421
Copied::new(self)
34233422
}
@@ -3462,10 +3461,9 @@ pub trait Iterator {
34623461
/// ```
34633462
#[stable(feature = "rust1", since = "1.0.0")]
34643463
#[rustc_diagnostic_item = "iter_cloned"]
3465-
fn cloned<'a, T: 'a>(self) -> Cloned<Self>
3464+
fn cloned<'a, T: Clone + 'a>(self) -> Cloned<Self>
34663465
where
34673466
Self: Sized + Iterator<Item = &'a T>,
3468-
T: Clone,
34693467
{
34703468
Cloned::new(self)
34713469
}

0 commit comments

Comments
 (0)