]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_pass_by_value.stderr
Merge branch 'master' into option_option_pr
[rust.git] / tests / ui / needless_pass_by_value.stderr
1 error: this argument is passed by value, but not consumed in the function body
2   --> $DIR/needless_pass_by_value.rs:12:23
3    |
4 12 | 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]`
6    |
7    = note: `-D needless-pass-by-value` implied by `-D warnings`
8
9 error: this argument is passed by value, but not consumed in the function body
10   --> $DIR/needless_pass_by_value.rs:26:11
11    |
12 26 | fn bar(x: String, y: Wrapper) {
13    |           ^^^^^^ help: consider changing the type to: `&str`
14
15 error: this argument is passed by value, but not consumed in the function body
16   --> $DIR/needless_pass_by_value.rs:26:22
17    |
18 26 | fn bar(x: String, y: Wrapper) {
19    |                      ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
20
21 error: this argument is passed by value, but not consumed in the function body
22   --> $DIR/needless_pass_by_value.rs:32:71
23    |
24 32 | fn test_borrow_trait<T: Borrow<str>, U: AsRef<str>, V>(t: T, u: U, v: V) {
25    |                                                                       ^ help: consider taking a reference instead: `&V`
26
27 error: this argument is passed by value, but not consumed in the function body
28   --> $DIR/needless_pass_by_value.rs:44:18
29    |
30 44 | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
31    |                  ^^^^^^^^^^^^^^^^^^^^^^
32 help: consider taking a reference instead
33    |
34 44 | fn test_match(x: &Option<Option<String>>, y: Option<Option<String>>) {
35 45 |     match *x {
36    |
37
38 error: this argument is passed by value, but not consumed in the function body
39   --> $DIR/needless_pass_by_value.rs:57:24
40    |
41 57 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
42    |                        ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
43
44 error: this argument is passed by value, but not consumed in the function body
45   --> $DIR/needless_pass_by_value.rs:57:36
46    |
47 57 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
48    |                                    ^^^^^^^
49 help: consider taking a reference instead
50    |
51 57 | fn test_destructure(x: Wrapper, y: &Wrapper, z: Wrapper) {
52 58 |     let Wrapper(s) = z; // moved
53 59 |     let Wrapper(ref t) = *y; // not moved
54 60 |     let Wrapper(_) = *y; // still not moved
55    |
56
57 error: this argument is passed by value, but not consumed in the function body
58   --> $DIR/needless_pass_by_value.rs:73:49
59    |
60 73 | fn test_blanket_ref<T: Foo, S: Serialize>(_foo: T, _serializable: S) {}
61    |                                                 ^ help: consider taking a reference instead: `&T`
62
63 error: this argument is passed by value, but not consumed in the function body
64   --> $DIR/needless_pass_by_value.rs:75:18
65    |
66 75 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
67    |                  ^^^^^^ help: consider taking a reference instead: `&String`
68
69 error: this argument is passed by value, but not consumed in the function body
70   --> $DIR/needless_pass_by_value.rs:75:29
71    |
72 75 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
73    |                             ^^^^^^
74 help: consider changing the type to
75    |
76 75 | fn issue_2114(s: String, t: &str, u: Vec<i32>, v: Vec<i32>) {
77    |                             ^^^^
78 help: change `t.clone()` to
79    |
80 77 |     let _ = t.to_string();
81    |             ^^^^^^^^^^^^^
82
83 error: this argument is passed by value, but not consumed in the function body
84   --> $DIR/needless_pass_by_value.rs:75:40
85    |
86 75 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
87    |                                        ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
88
89 error: this argument is passed by value, but not consumed in the function body
90   --> $DIR/needless_pass_by_value.rs:75:53
91    |
92 75 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
93    |                                                     ^^^^^^^^
94 help: consider changing the type to
95    |
96 75 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: &[i32]) {
97    |                                                     ^^^^^^
98 help: change `v.clone()` to
99    |
100 79 |     let _ = v.to_owned();
101    |             ^^^^^^^^^^^^
102
103 error: this argument is passed by value, but not consumed in the function body
104   --> $DIR/needless_pass_by_value.rs:87:12
105    |
106 87 |         s: String,
107    |            ^^^^^^ help: consider changing the type to: `&str`
108
109 error: this argument is passed by value, but not consumed in the function body
110   --> $DIR/needless_pass_by_value.rs:88:12
111    |
112 88 |         t: String,
113    |            ^^^^^^ help: consider taking a reference instead: `&String`
114
115 error: this argument is passed by value, but not consumed in the function body
116    --> $DIR/needless_pass_by_value.rs:100:13
117     |
118 100 |         _u: U,
119     |             ^ help: consider taking a reference instead: `&U`
120
121 error: this argument is passed by value, but not consumed in the function body
122    --> $DIR/needless_pass_by_value.rs:101:13
123     |
124 101 |         _s: Self,
125     |             ^^^^ help: consider taking a reference instead: `&Self`
126
127 error: aborting due to 16 previous errors
128