]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/tests/ui/explicit_auto_deref.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / explicit_auto_deref.rs
index deedafad153b97ae0edd6d777637516d65c33410..c1894258f4d84312d891f55472908489c5173aba 100644 (file)
@@ -266,4 +266,19 @@ fn main() {
         }
         *x
     };
+
+    trait WithAssoc {
+        type Assoc: ?Sized;
+    }
+    impl WithAssoc for String {
+        type Assoc = str;
+    }
+    fn takes_assoc<T: WithAssoc>(_: &T::Assoc) -> T {
+        unimplemented!()
+    }
+    let _: String = takes_assoc(&*String::new());
+
+    // Issue #9901
+    fn takes_ref(_: &i32) {}
+    takes_ref(*Box::new(&0i32));
 }