1 error: this argument is passed by value, but not consumed in the function body
2 --> needless_pass_by_value.rs:9:23
4 9 | fn foo<T: Default>(v: Vec<T>, w: Vec<T>, mut x: Vec<T>, y: Vec<T>) -> Vec<T> {
5 | ^^^^^^ help: consider changing the type to `&[T]`
7 = note: `-D needless-pass-by-value` implied by `-D warnings`
9 error: this argument is passed by value, but not consumed in the function body
10 --> needless_pass_by_value.rs:23:11
12 23 | fn bar(x: String, y: Wrapper) {
13 | ^^^^^^ help: consider changing the type to `&str`
15 = note: `-D needless-pass-by-value` implied by `-D warnings`
17 error: this argument is passed by value, but not consumed in the function body
18 --> needless_pass_by_value.rs:23:22
20 23 | fn bar(x: String, y: Wrapper) {
21 | ^^^^^^^ help: consider taking a reference instead `&Wrapper`
23 = note: `-D needless-pass-by-value` implied by `-D warnings`
25 error: this argument is passed by value, but not consumed in the function body
26 --> needless_pass_by_value.rs:29:63
28 29 | fn test_borrow_trait<T: std::borrow::Borrow<str>, U>(t: T, u: U) {
29 | ^ help: consider taking a reference instead `&U`
31 = note: `-D needless-pass-by-value` implied by `-D warnings`
33 error: this argument is passed by value, but not consumed in the function body
34 --> needless_pass_by_value.rs:40:18
36 40 | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
37 | ^^^^^^^^^^^^^^^^^^^^^^
39 = note: `-D needless-pass-by-value` implied by `-D warnings`
40 help: consider taking a reference instead
41 | fn test_match(x: &Option<Option<String>>, y: Option<Option<String>>) {
44 error: this argument is passed by value, but not consumed in the function body
45 --> needless_pass_by_value.rs:53:24
47 53 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
48 | ^^^^^^^ help: consider taking a reference instead `&Wrapper`
50 = note: `-D needless-pass-by-value` implied by `-D warnings`
52 error: this argument is passed by value, but not consumed in the function body
53 --> needless_pass_by_value.rs:53:36
55 53 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
58 = note: `-D needless-pass-by-value` implied by `-D warnings`
59 help: consider taking a reference instead
60 | fn test_destructure(x: Wrapper, y: &Wrapper, z: Wrapper) {
61 | let Wrapper(s) = z; // moved
62 | let Wrapper(ref t) = *y; // not moved
63 | let Wrapper(_) = *y; // still not moved
65 error: aborting due to previous error(s)
68 To learn more, run the command again with --verbose.