about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarijn Schouten <mhkbst@gmail.com>2025-07-02 13:27:29 +0000
committerMarijn Schouten <mhkbst@gmail.com>2025-07-18 20:13:24 +0000
commitc79f62d1ea5d210de9bc98ddc7e0588533a2b311 (patch)
treefce5a64b767605b34cab8b3c236c728358df5326
parentca4a712b59b9ed216e8bb6e24140b08d7020c68c (diff)
downloadrust-c79f62d1ea5d210de9bc98ddc7e0588533a2b311.tar.gz
rust-c79f62d1ea5d210de9bc98ddc7e0588533a2b311.zip
clippy fix: bound in one place
-rw-r--r--library/core/src/cmp.rs5
-rw-r--r--library/core/src/iter/traits/iterator.rs8
2 files changed, 7 insertions, 6 deletions
diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs
index b1ca3701fa5..7abadc9124b 100644
--- a/library/core/src/cmp.rs
+++ b/library/core/src/cmp.rs
@@ -1481,13 +1481,14 @@ pub trait PartialOrd<Rhs: PointeeSized = Self>: PartialEq<Rhs> + PointeeSized {
     }
 }
 
-fn default_chaining_impl<T: PointeeSized, U: PointeeSized>(
+fn default_chaining_impl<T, U>(
     lhs: &T,
     rhs: &U,
     p: impl FnOnce(Ordering) -> bool,
 ) -> ControlFlow<bool>
 where
-    T: PartialOrd<U>,
+    T: PartialOrd<U> + PointeeSized,
+    U: PointeeSized,
 {
     // It's important that this only call `partial_cmp` once, not call `eq` then
     // one of the relational operators.  We don't want to `bcmp`-then-`memcp` a
diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs
index f296792b1dc..10f9d464f7d 100644
--- a/library/core/src/iter/traits/iterator.rs
+++ b/library/core/src/iter/traits/iterator.rs
@@ -3414,10 +3414,10 @@ pub trait Iterator {
     /// ```
     #[stable(feature = "iter_copied", since = "1.36.0")]
     #[rustc_diagnostic_item = "iter_copied"]
-    fn copied<'a, T: 'a>(self) -> Copied<Self>
+    fn copied<'a, T>(self) -> Copied<Self>
     where
+        T: Copy + 'a,
         Self: Sized + Iterator<Item = &'a T>,
-        T: Copy,
     {
         Copied::new(self)
     }
@@ -3462,10 +3462,10 @@ pub trait Iterator {
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_diagnostic_item = "iter_cloned"]
-    fn cloned<'a, T: 'a>(self) -> Cloned<Self>
+    fn cloned<'a, T>(self) -> Cloned<Self>
     where
+        T: Clone + 'a,
         Self: Sized + Iterator<Item = &'a T>,
-        T: Clone,
     {
         Cloned::new(self)
     }