]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/needless_borrow.rs
Auto merge of #99422 - Dylan-DPC:rollup-htjofm6, r=Dylan-DPC
[rust.git] / src / tools / clippy / tests / ui / needless_borrow.rs
index d636a40100378c0f5bebc5cbb3f85b9f902ab365..3ae4722a1f8985e414ea3a9d49f85ccb397bf770 100644 (file)
@@ -115,6 +115,18 @@ impl FooRef for &'_ () {
         fn foo_ref(&self) {}
     }
     (&&()).foo_ref(); // Don't lint. `&()` will call `<() as FooRef>::foo_ref`
+
+    struct S;
+    impl From<S> for u32 {
+        fn from(s: S) -> Self {
+            (&s).into()
+        }
+    }
+    impl From<&S> for u32 {
+        fn from(s: &S) -> Self {
+            0
+        }
+    }
 }
 
 #[allow(clippy::needless_borrowed_reference)]