1 // Checks that certain traits for which we don't want to suggest borrowing
2 // are blacklisted and don't cause the suggestion to be issued.
4 #![feature(generators)]
6 fn f_copy<T: Copy>(t: T) {}
7 fn f_clone<T: Clone>(t: T) {}
8 fn f_unpin<T: Unpin>(t: T) {}
9 fn f_sized<T: Sized>(t: T) {}
10 fn f_send<T: Send>(t: T) {}
15 f_copy("".to_string()); //~ ERROR: the trait bound `String: Copy` is not satisfied [E0277]
16 f_clone(S); //~ ERROR: the trait bound `S: Clone` is not satisfied [E0277]
17 f_unpin(static || { yield; });
18 //~^ ERROR: cannot be unpinned [E0277]
21 let ref_cl: &dyn Fn() -> () = &cl;
23 //~^ ERROR: the size for values of type `dyn Fn()` cannot be known at compilation time [E0277]
27 f_send(rc); //~ ERROR: `Rc<{integer}>` cannot be sent between threads safely [E0277]