diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-07-25 11:16:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-25 11:16:34 +0200 |
| commit | dd159ee24e06badc4289bb510f75949908d1a422 (patch) | |
| tree | 287517ab29204fe589dfa32e849dbf22e419cb73 | |
| parent | e9744c9ec1587144de03e4b6e5aa1597e60c7cb9 (diff) | |
| parent | b315e9a2ceb341e07983f028347beafaa60cda0a (diff) | |
| download | rust-dd159ee24e06badc4289bb510f75949908d1a422.tar.gz rust-dd159ee24e06badc4289bb510f75949908d1a422.zip | |
Rollup merge of #143424 - hkBst:auto-deref, r=jhpratt
clippy fix: rely on autoderef Changes instances of `&**self` to `self`.
| -rw-r--r-- | library/core/src/borrow.rs | 6 | ||||
| -rw-r--r-- | library/core/src/clone.rs | 2 | ||||
| -rw-r--r-- | library/core/src/ops/deref.rs | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/library/core/src/borrow.rs b/library/core/src/borrow.rs index ccb1cc4e974..da05f236d2f 100644 --- a/library/core/src/borrow.rs +++ b/library/core/src/borrow.rs @@ -223,20 +223,20 @@ impl<T: ?Sized> BorrowMut<T> for T { #[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> Borrow<T> for &T { fn borrow(&self) -> &T { - &**self + self } } #[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> Borrow<T> for &mut T { fn borrow(&self) -> &T { - &**self + self } } #[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> BorrowMut<T> for &mut T { fn borrow_mut(&mut self) -> &mut T { - &mut **self + self } } diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs index a34d1b4a064..51d037ddfd2 100644 --- a/library/core/src/clone.rs +++ b/library/core/src/clone.rs @@ -590,7 +590,7 @@ mod impls { #[inline(always)] #[rustc_diagnostic_item = "noop_method_clone"] fn clone(&self) -> Self { - *self + self } } diff --git a/library/core/src/ops/deref.rs b/library/core/src/ops/deref.rs index 9d9d18095bc..c2dede9fa08 100644 --- a/library/core/src/ops/deref.rs +++ b/library/core/src/ops/deref.rs @@ -158,7 +158,7 @@ impl<T: ?Sized> const Deref for &T { #[rustc_diagnostic_item = "noop_method_deref"] fn deref(&self) -> &T { - *self + self } } @@ -171,7 +171,7 @@ impl<T: ?Sized> const Deref for &mut T { type Target = T; fn deref(&self) -> &T { - *self + self } } @@ -280,7 +280,7 @@ pub trait DerefMut: ~const Deref + PointeeSized { #[rustc_const_unstable(feature = "const_deref", issue = "88955")] impl<T: ?Sized> const DerefMut for &mut T { fn deref_mut(&mut self) -> &mut T { - *self + self } } |
