Skip to content

Commit c79f62d

Browse files
committed
clippy fix: bound in one place
1 parent ca4a712 commit c79f62d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

library/core/src/cmp.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,13 +1481,14 @@ 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, U>(
14851485
lhs: &T,
14861486
rhs: &U,
14871487
p: impl FnOnce(Ordering) -> bool,
14881488
) -> ControlFlow<bool>
14891489
where
1490-
T: PartialOrd<U>,
1490+
T: PartialOrd<U> + PointeeSized,
1491+
U: PointeeSized,
14911492
{
14921493
// It's important that this only call `partial_cmp` once, not call `eq` then
14931494
// one of the relational operators. We don't want to `bcmp`-then-`memcp` a

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3414,10 +3414,10 @@ 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>(self) -> Copied<Self>
34183418
where
3419+
T: Copy + 'a,
34193420
Self: Sized + Iterator<Item = &'a T>,
3420-
T: Copy,
34213421
{
34223422
Copied::new(self)
34233423
}
@@ -3462,10 +3462,10 @@ pub trait Iterator {
34623462
/// ```
34633463
#[stable(feature = "rust1", since = "1.0.0")]
34643464
#[rustc_diagnostic_item = "iter_cloned"]
3465-
fn cloned<'a, T: 'a>(self) -> Cloned<Self>
3465+
fn cloned<'a, T>(self) -> Cloned<Self>
34663466
where
3467+
T: Clone + 'a,
34673468
Self: Sized + Iterator<Item = &'a T>,
3468-
T: Clone,
34693469
{
34703470
Cloned::new(self)
34713471
}

0 commit comments

Comments
 (0)