1 // check-pass
2 // Check tautalogically false `Copy` bounds
3 #![feature(trivial_bounds)]
4 
copy_string(t: String) -> String where String: Copy5 fn 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: Copy12 fn 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: Copy16 fn 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: Copy22 fn 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)30 fn is_copy<T: Copy>(t: &T) {}
31 
32 
main()33 fn main() {}
34