]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_pass_by_value.stderr
Auto merge of #4595 - rust-lang:rustbot, r=flip1995
[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:17: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:31: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:31: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:37: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:49: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:62: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:62: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:78: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:80: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:80:29
59    |
60 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
61    |                             ^^^^^^
62 help: consider changing the type to
63    |
64 LL | fn issue_2114(s: String, t: &str, u: Vec<i32>, v: Vec<i32>) {
65    |                             ^^^^
66 help: change `t.clone()` to
67    |
68 LL |     let _ = t.to_string();
69    |             ^^^^^^^^^^^^^
70
71 error: this argument is passed by value, but not consumed in the function body
72   --> $DIR/needless_pass_by_value.rs:80:40
73    |
74 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
75    |                                        ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
76
77 error: this argument is passed by value, but not consumed in the function body
78   --> $DIR/needless_pass_by_value.rs:80:53
79    |
80 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
81    |                                                     ^^^^^^^^
82 help: consider changing the type to
83    |
84 LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: &[i32]) {
85    |                                                     ^^^^^^
86 help: change `v.clone()` to
87    |
88 LL |     let _ = v.to_owned();
89    |             ^^^^^^^^^^^^
90
91 error: this argument is passed by value, but not consumed in the function body
92   --> $DIR/needless_pass_by_value.rs:93:12
93    |
94 LL |         s: String,
95    |            ^^^^^^ help: consider changing the type to: `&str`
96
97 error: this argument is passed by value, but not consumed in the function body
98   --> $DIR/needless_pass_by_value.rs:94:12
99    |
100 LL |         t: String,
101    |            ^^^^^^ help: consider taking a reference instead: `&String`
102
103 error: this argument is passed by value, but not consumed in the function body
104   --> $DIR/needless_pass_by_value.rs:103:23
105    |
106 LL |     fn baz(&self, _u: U, _s: Self) {}
107    |                       ^ help: consider taking a reference instead: `&U`
108
109 error: this argument is passed by value, but not consumed in the function body
110   --> $DIR/needless_pass_by_value.rs:103:30
111    |
112 LL |     fn baz(&self, _u: U, _s: Self) {}
113    |                              ^^^^ help: consider taking a reference instead: `&Self`
114
115 error: this argument is passed by value, but not consumed in the function body
116   --> $DIR/needless_pass_by_value.rs:125:24
117    |
118 LL | fn bar_copy(x: u32, y: CopyWrapper) {
119    |                        ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
120    |
121 help: consider marking this type as Copy
122   --> $DIR/needless_pass_by_value.rs:123:1
123    |
124 LL | struct CopyWrapper(u32);
125    | ^^^^^^^^^^^^^^^^^^^^^^^^
126
127 error: this argument is passed by value, but not consumed in the function body
128   --> $DIR/needless_pass_by_value.rs:131:29
129    |
130 LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
131    |                             ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
132    |
133 help: consider marking this type as Copy
134   --> $DIR/needless_pass_by_value.rs:123:1
135    |
136 LL | struct CopyWrapper(u32);
137    | ^^^^^^^^^^^^^^^^^^^^^^^^
138
139 error: this argument is passed by value, but not consumed in the function body
140   --> $DIR/needless_pass_by_value.rs:131:45
141    |
142 LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
143    |                                             ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
144    |
145 help: consider marking this type as Copy
146   --> $DIR/needless_pass_by_value.rs:123:1
147    |
148 LL | struct CopyWrapper(u32);
149    | ^^^^^^^^^^^^^^^^^^^^^^^^
150
151 error: this argument is passed by value, but not consumed in the function body
152   --> $DIR/needless_pass_by_value.rs:131:61
153    |
154 LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
155    |                                                             ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
156    |
157 help: consider marking this type as Copy
158   --> $DIR/needless_pass_by_value.rs:123:1
159    |
160 LL | struct CopyWrapper(u32);
161    | ^^^^^^^^^^^^^^^^^^^^^^^^
162
163 error: this argument is passed by value, but not consumed in the function body
164   --> $DIR/needless_pass_by_value.rs:143:40
165    |
166 LL | fn some_fun<'b, S: Bar<'b, ()>>(_item: S) {}
167    |                                        ^ help: consider taking a reference instead: `&S`
168
169 error: this argument is passed by value, but not consumed in the function body
170   --> $DIR/needless_pass_by_value.rs:148:20
171    |
172 LL | fn more_fun(_item: impl Club<'static, i32>) {}
173    |                    ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>`
174
175 error: aborting due to 22 previous errors
176