]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/needless_pass_by_value.stderr
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / needless_pass_by_value.stderr
CommitLineData
f20569fa
XL
1error: this argument is passed by value, but not consumed in the function body
2 --> $DIR/needless_pass_by_value.rs:18:23
3 |
4LL | 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
9error: this argument is passed by value, but not consumed in the function body
10 --> $DIR/needless_pass_by_value.rs:32:11
11 |
12LL | fn bar(x: String, y: Wrapper) {
13 | ^^^^^^ help: consider changing the type to: `&str`
14
15error: this argument is passed by value, but not consumed in the function body
16 --> $DIR/needless_pass_by_value.rs:32:22
17 |
18LL | fn bar(x: String, y: Wrapper) {
19 | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
20
21error: this argument is passed by value, but not consumed in the function body
22 --> $DIR/needless_pass_by_value.rs:38:71
23 |
24LL | 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
27error: this argument is passed by value, but not consumed in the function body
28 --> $DIR/needless_pass_by_value.rs:50:18
29 |
30LL | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
31 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&Option<Option<String>>`
32
33error: this argument is passed by value, but not consumed in the function body
34 --> $DIR/needless_pass_by_value.rs:63:24
35 |
36LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
37 | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
38
39error: this argument is passed by value, but not consumed in the function body
40 --> $DIR/needless_pass_by_value.rs:63:36
41 |
42LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
43 | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
44
45error: this argument is passed by value, but not consumed in the function body
46 --> $DIR/needless_pass_by_value.rs:79:49
47 |
48LL | fn test_blanket_ref<T: Foo, S: Serialize>(_foo: T, _serializable: S) {}
49 | ^ help: consider taking a reference instead: `&T`
50
51error: this argument is passed by value, but not consumed in the function body
52 --> $DIR/needless_pass_by_value.rs:81:18
53 |
54LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
55 | ^^^^^^ help: consider taking a reference instead: `&String`
56
57error: this argument is passed by value, but not consumed in the function body
58 --> $DIR/needless_pass_by_value.rs:81:29
59 |
60LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
61 | ^^^^^^
62 |
63help: consider changing the type to
64 |
65LL | fn issue_2114(s: String, t: &str, u: Vec<i32>, v: Vec<i32>) {
94222f64 66 | ~~~~
f20569fa
XL
67help: change `t.clone()` to
68 |
69LL | let _ = t.to_string();
94222f64 70 | ~~~~~~~~~~~~~
f20569fa
XL
71
72error: this argument is passed by value, but not consumed in the function body
73 --> $DIR/needless_pass_by_value.rs:81:40
74 |
75LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
76 | ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
77
78error: this argument is passed by value, but not consumed in the function body
79 --> $DIR/needless_pass_by_value.rs:81:53
80 |
81LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
82 | ^^^^^^^^
83 |
84help: consider changing the type to
85 |
86LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: &[i32]) {
94222f64 87 | ~~~~~~
f20569fa
XL
88help: change `v.clone()` to
89 |
90LL | let _ = v.to_owned();
94222f64 91 | ~~~~~~~~~~~~
f20569fa
XL
92
93error: this argument is passed by value, but not consumed in the function body
94 --> $DIR/needless_pass_by_value.rs:94:12
95 |
96LL | s: String,
97 | ^^^^^^ help: consider changing the type to: `&str`
98
99error: this argument is passed by value, but not consumed in the function body
100 --> $DIR/needless_pass_by_value.rs:95:12
101 |
102LL | t: String,
103 | ^^^^^^ help: consider taking a reference instead: `&String`
104
105error: this argument is passed by value, but not consumed in the function body
106 --> $DIR/needless_pass_by_value.rs:104:23
107 |
108LL | fn baz(&self, _u: U, _s: Self) {}
109 | ^ help: consider taking a reference instead: `&U`
110
111error: this argument is passed by value, but not consumed in the function body
112 --> $DIR/needless_pass_by_value.rs:104:30
113 |
114LL | fn baz(&self, _u: U, _s: Self) {}
115 | ^^^^ help: consider taking a reference instead: `&Self`
116
117error: this argument is passed by value, but not consumed in the function body
118 --> $DIR/needless_pass_by_value.rs:126:24
119 |
120LL | fn bar_copy(x: u32, y: CopyWrapper) {
121 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
122 |
123help: consider marking this type as `Copy`
124 --> $DIR/needless_pass_by_value.rs:124:1
125 |
126LL | struct CopyWrapper(u32);
127 | ^^^^^^^^^^^^^^^^^^^^^^^^
128
129error: this argument is passed by value, but not consumed in the function body
130 --> $DIR/needless_pass_by_value.rs:132:29
131 |
132LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
133 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
134 |
135help: consider marking this type as `Copy`
136 --> $DIR/needless_pass_by_value.rs:124:1
137 |
138LL | struct CopyWrapper(u32);
139 | ^^^^^^^^^^^^^^^^^^^^^^^^
140
141error: this argument is passed by value, but not consumed in the function body
142 --> $DIR/needless_pass_by_value.rs:132:45
143 |
144LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
145 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
146 |
147help: consider marking this type as `Copy`
148 --> $DIR/needless_pass_by_value.rs:124:1
149 |
150LL | struct CopyWrapper(u32);
151 | ^^^^^^^^^^^^^^^^^^^^^^^^
152
153error: this argument is passed by value, but not consumed in the function body
154 --> $DIR/needless_pass_by_value.rs:132:61
155 |
156LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
157 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
158 |
159help: consider marking this type as `Copy`
160 --> $DIR/needless_pass_by_value.rs:124:1
161 |
162LL | struct CopyWrapper(u32);
163 | ^^^^^^^^^^^^^^^^^^^^^^^^
164
165error: this argument is passed by value, but not consumed in the function body
166 --> $DIR/needless_pass_by_value.rs:144:40
167 |
168LL | fn some_fun<'b, S: Bar<'b, ()>>(_item: S) {}
169 | ^ help: consider taking a reference instead: `&S`
170
171error: this argument is passed by value, but not consumed in the function body
172 --> $DIR/needless_pass_by_value.rs:149:20
173 |
174LL | fn more_fun(_item: impl Club<'static, i32>) {}
175 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>`
176
177error: aborting due to 22 previous errors
178