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