4 #![deny(needless_pass_by_value)]
8 // `w`, `x` and `y` are allowed (moved or mutated)
9 fn foo<T: Default>(v: Vec<T>, w: Vec<T>, mut x: Vec<T>, y: Vec<T>) -> Vec<T> {
10 assert_eq!(v.len(), 42);
19 fn consume<T>(_: T) {}
21 struct Wrapper(String);
23 fn bar(x: String, y: Wrapper) {
24 assert_eq!(x.len(), 42);
25 assert_eq!(y.0.len(), 42);
28 fn test_borrow_trait<T: std::borrow::Borrow<str>, U>(t: T, u: U) {
29 // U implements `Borrow<U>`, but warned correctly
30 println!("{}", t.borrow());
35 fn test_fn<F: Fn(i32) -> i32>(f: F) {