Skip to content

Commit 093831b

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

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-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: 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)