1 // Regression test for #68641
3 #![feature(generic_associated_types)]
8 fn copy<'a>(item: &Self::Item<'a>) -> Self::Item<'a> {
13 impl<T> UnsafeCopy for T {
15 //~^ ERROR the trait bound `T: Copy` is not satisfied
19 let mut s = String::from("Hello world!");
21 let copy = String::copy(&s);
23 // Do we indeed point to the samme memory?
24 assert!(s.as_ptr() == copy.as_ptr());
26 // Any use of `copy` is certeinly UB after this