1 trait UnsafeCopy<'a, T: Copy> 2 where 3 for<'b> <Self as UnsafeCopy<'b, T>>::Item: std::ops::Deref<Target = T>, 4 { 5 type Item; 6 bug(item: &Self::Item) -> ()7 fn bug(item: &Self::Item) -> () { 8 let x: T = **item; 9 &x as *const _; 10 } 11 } 12 13 impl<T: Copy + std::ops::Deref> UnsafeCopy<'_, T> for T { 14 //~^ type mismatch resolving `<T as Deref>::Target == T` 15 type Item = T; 16 } 17 main()18pub fn main() { 19 <&'static str>::bug(&""); 20 } 21