1 // check-pass 2 // Check tautalogically false `Copy` bounds 3 #![feature(trivial_bounds)] 4 copy_string(t: String) -> String where String: Copy5fn copy_string(t: String) -> String where String: Copy { //~ WARNING trivial_bounds 6 is_copy(&t); 7 let x = t; 8 drop(t); 9 t 10 } 11 copy_out_string(t: &String) -> String where String: Copy12fn copy_out_string(t: &String) -> String where String: Copy { //~ WARNING trivial_bounds 13 *t 14 } 15 copy_string_with_param<T>(x: String) where String: Copy16fn copy_string_with_param<T>(x: String) where String: Copy { //~ WARNING trivial_bounds 17 let y = x; 18 let z = x; 19 } 20 21 // Check that no reborrowing occurs copy_mut<'a>(t: &&'a mut i32) -> &'a mut i32 where for<'b> &'b mut i32: Copy22fn copy_mut<'a>(t: &&'a mut i32) -> &'a mut i32 where for<'b> &'b mut i32: Copy { 23 //~^ WARNING trivial_bounds 24 is_copy(t); 25 let x = *t; 26 drop(x); 27 x 28 } 29 is_copy<T: Copy>(t: &T)30fn is_copy<T: Copy>(t: &T) {} 31 32 main()33fn main() {} 34