1 #![feature(associated_type_defaults)]
6 type Copy<T>: Copy = Box<T>;
7 //~^ ERROR the trait bound `Box<T>: Copy` is not satisfied
8 //~^^ ERROR the trait bound `T: Clone` is not satisfied
9 fn copy<T>(x: &Self::Copy<T>) -> Self::Copy<T> {
14 impl<T> UnsafeCopy for T {}
17 let b = Box::new(42usize);
18 let copy = <()>::copy(&b);
20 let raw_b = Box::deref(&b) as *const _;
21 let raw_copy = Box::deref(©) as *const _;
23 // assert the addresses.
24 assert_eq!(raw_b, raw_copy);