]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_pass_by_value.stderr
Update references
[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:18:23
3    |
4 LL | 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 clippy::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:32:11
11    |
12 LL | 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:32:22
17    |
18 LL | 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:38:71
23    |
24 LL | 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:50:18
29    |
30 LL | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
31    |                  ^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&Option<Option<String>>`
32
33 error: this argument is passed by value, but not consumed in the function body
34   --> $DIR/needless_pass_by_value.rs:63:24
35    |
36 LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
37    |                        ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
38
39 error: this argument is passed by value, but not consumed in the function body
40   --> $DIR/needless_pass_by_value.rs:63:36
41    |
42 LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
43    |                                    ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
44
45 error: this argument is passed by value, but not consumed in the function body
46   --> $DIR/needless_pass_by_value.rs:79:49
47    |
48 LL | fn test_blanket_ref<T: Foo, S: Serialize>(_foo: T, _serializable: S) {}
49    |                                                 ^ help: consider taking a reference instead: `&T`
50
51 error: this argument is passed by value, but not consumed in the function body
52   --> $DIR/needless_pass_by_value.rs:81:18
53    |
54 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
55    |                  ^^^^^^ help: consider taking a reference instead: `&String`
56
57 error: this argument is passed by value, but not consumed in the function body
58   --> $DIR/needless_pass_by_value.rs:81:29
59    |
60 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
61    |                             ^^^^^^
62    |
63 help: consider changing the type to
64    |
65 LL | fn issue_2114(s: String, t: &str, u: Vec<i32>, v: Vec<i32>) {
66    |                             ^^^^
67 help: change `t.clone()` to
68    |
69 LL |     let _ = t.to_string();
70    |             ^^^^^^^^^^^^^
71
72 error: this argument is passed by value, but not consumed in the function body
73   --> $DIR/needless_pass_by_value.rs:81:40
74    |
75 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
76    |                                        ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
77
78 error: this argument is passed by value, but not consumed in the function body
79   --> $DIR/needless_pass_by_value.rs:81:53
80    |
81 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
82    |                                                     ^^^^^^^^
83    |
84 help: consider changing the type to
85    |
86 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: &[i32]) {
87    |                                                     ^^^^^^
88 help: change `v.clone()` to
89    |
90 LL |     let _ = v.to_owned();
91    |             ^^^^^^^^^^^^
92
93 error: non-binding let on a type that implements `Drop`
94   --> $DIR/needless_pass_by_value.rs:85:5
95    |
96 LL |     let _ = v.clone();
97    |     ^^^^^^^^^^^^^^^^^^
98    |
99    = note: `#[deny(clippy::let_underscore_drop)]` on by default
100    = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
101
102 error: this argument is passed by value, but not consumed in the function body
103   --> $DIR/needless_pass_by_value.rs:94:12
104    |
105 LL |         s: String,
106    |            ^^^^^^ help: consider changing the type to: `&str`
107
108 error: this argument is passed by value, but not consumed in the function body
109   --> $DIR/needless_pass_by_value.rs:95:12
110    |
111 LL |         t: String,
112    |            ^^^^^^ help: consider taking a reference instead: `&String`
113
114 error: this argument is passed by value, but not consumed in the function body
115   --> $DIR/needless_pass_by_value.rs:104:23
116    |
117 LL |     fn baz(&self, _u: U, _s: Self) {}
118    |                       ^ help: consider taking a reference instead: `&U`
119
120 error: this argument is passed by value, but not consumed in the function body
121   --> $DIR/needless_pass_by_value.rs:104:30
122    |
123 LL |     fn baz(&self, _u: U, _s: Self) {}
124    |                              ^^^^ help: consider taking a reference instead: `&Self`
125
126 error: this argument is passed by value, but not consumed in the function body
127   --> $DIR/needless_pass_by_value.rs:126:24
128    |
129 LL | fn bar_copy(x: u32, y: CopyWrapper) {
130    |                        ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
131    |
132 help: consider marking this type as `Copy`
133   --> $DIR/needless_pass_by_value.rs:124:1
134    |
135 LL | struct CopyWrapper(u32);
136    | ^^^^^^^^^^^^^^^^^^^^^^^^
137
138 error: this argument is passed by value, but not consumed in the function body
139   --> $DIR/needless_pass_by_value.rs:132:29
140    |
141 LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
142    |                             ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
143    |
144 help: consider marking this type as `Copy`
145   --> $DIR/needless_pass_by_value.rs:124:1
146    |
147 LL | struct CopyWrapper(u32);
148    | ^^^^^^^^^^^^^^^^^^^^^^^^
149
150 error: this argument is passed by value, but not consumed in the function body
151   --> $DIR/needless_pass_by_value.rs:132:45
152    |
153 LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
154    |                                             ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
155    |
156 help: consider marking this type as `Copy`
157   --> $DIR/needless_pass_by_value.rs:124:1
158    |
159 LL | struct CopyWrapper(u32);
160    | ^^^^^^^^^^^^^^^^^^^^^^^^
161
162 error: this argument is passed by value, but not consumed in the function body
163   --> $DIR/needless_pass_by_value.rs:132:61
164    |
165 LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
166    |                                                             ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
167    |
168 help: consider marking this type as `Copy`
169   --> $DIR/needless_pass_by_value.rs:124:1
170    |
171 LL | struct CopyWrapper(u32);
172    | ^^^^^^^^^^^^^^^^^^^^^^^^
173
174 error: this argument is passed by value, but not consumed in the function body
175   --> $DIR/needless_pass_by_value.rs:144:40
176    |
177 LL | fn some_fun<'b, S: Bar<'b, ()>>(_item: S) {}
178    |                                        ^ help: consider taking a reference instead: `&S`
179
180 error: this argument is passed by value, but not consumed in the function body
181   --> $DIR/needless_pass_by_value.rs:149:20
182    |
183 LL | fn more_fun(_item: impl Club<'static, i32>) {}
184    |                    ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>`
185
186 error: aborting due to 23 previous errors
187