]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/needless_pass_by_value.stderr
New upstream version 1.28.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / needless_pass_by_value.stderr
CommitLineData
ea8adc8c 1error: this argument is passed by value, but not consumed in the function body
2c00a5a8 2 --> $DIR/needless_pass_by_value.rs:14:23
abe05a73 3 |
2c00a5a8 414 | fn foo<T: Default>(v: Vec<T>, w: Vec<T>, mut x: Vec<T>, y: Vec<T>) -> Vec<T> {
abe05a73
XL
5 | ^^^^^^ help: consider changing the type to: `&[T]`
6 |
7 = note: `-D needless-pass-by-value` implied by `-D warnings`
ea8adc8c
XL
8
9error: this argument is passed by value, but not consumed in the function body
2c00a5a8 10 --> $DIR/needless_pass_by_value.rs:28:11
ea8adc8c 11 |
2c00a5a8 1228 | fn bar(x: String, y: Wrapper) {
ea8adc8c
XL
13 | ^^^^^^ help: consider changing the type to: `&str`
14
15error: this argument is passed by value, but not consumed in the function body
2c00a5a8 16 --> $DIR/needless_pass_by_value.rs:28:22
ea8adc8c 17 |
2c00a5a8 1828 | fn bar(x: String, y: Wrapper) {
ea8adc8c
XL
19 | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
20
21error: this argument is passed by value, but not consumed in the function body
2c00a5a8 22 --> $DIR/needless_pass_by_value.rs:34:71
ea8adc8c 23 |
2c00a5a8 2434 | fn test_borrow_trait<T: Borrow<str>, U: AsRef<str>, V>(t: T, u: U, v: V) {
abe05a73 25 | ^ help: consider taking a reference instead: `&V`
ea8adc8c
XL
26
27error: this argument is passed by value, but not consumed in the function body
2c00a5a8 28 --> $DIR/needless_pass_by_value.rs:46:18
ea8adc8c 29 |
2c00a5a8 3046 | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
ea8adc8c 31 | ^^^^^^^^^^^^^^^^^^^^^^
ea8adc8c
XL
32help: consider taking a reference instead
33 |
2c00a5a8
XL
3446 | fn test_match(x: &Option<Option<String>>, y: Option<Option<String>>) {
3547 | match *x {
ea8adc8c
XL
36 |
37
38error: this argument is passed by value, but not consumed in the function body
2c00a5a8 39 --> $DIR/needless_pass_by_value.rs:59:24
ea8adc8c 40 |
2c00a5a8 4159 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
ea8adc8c
XL
42 | ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
43
44error: this argument is passed by value, but not consumed in the function body
2c00a5a8 45 --> $DIR/needless_pass_by_value.rs:59:36
ea8adc8c 46 |
2c00a5a8 4759 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
ea8adc8c 48 | ^^^^^^^
ea8adc8c
XL
49help: consider taking a reference instead
50 |
2c00a5a8
XL
5159 | fn test_destructure(x: Wrapper, y: &Wrapper, z: Wrapper) {
5260 | let Wrapper(s) = z; // moved
5361 | let Wrapper(ref t) = *y; // not moved
5462 | let Wrapper(_) = *y; // still not moved
abe05a73
XL
55 |
56
57error: this argument is passed by value, but not consumed in the function body
2c00a5a8 58 --> $DIR/needless_pass_by_value.rs:75:49
abe05a73 59 |
2c00a5a8 6075 | fn test_blanket_ref<T: Foo, S: Serialize>(_foo: T, _serializable: S) {}
abe05a73
XL
61 | ^ help: consider taking a reference instead: `&T`
62
63error: this argument is passed by value, but not consumed in the function body
2c00a5a8 64 --> $DIR/needless_pass_by_value.rs:77:18
abe05a73 65 |
2c00a5a8 6677 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
abe05a73
XL
67 | ^^^^^^ help: consider taking a reference instead: `&String`
68
69error: this argument is passed by value, but not consumed in the function body
2c00a5a8 70 --> $DIR/needless_pass_by_value.rs:77:29
abe05a73 71 |
2c00a5a8 7277 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
abe05a73 73 | ^^^^^^
abe05a73
XL
74help: consider changing the type to
75 |
2c00a5a8 7677 | fn issue_2114(s: String, t: &str, u: Vec<i32>, v: Vec<i32>) {
abe05a73
XL
77 | ^^^^
78help: change `t.clone()` to
79 |
2c00a5a8 8079 | let _ = t.to_string();
abe05a73
XL
81 | ^^^^^^^^^^^^^
82
83error: this argument is passed by value, but not consumed in the function body
2c00a5a8 84 --> $DIR/needless_pass_by_value.rs:77:40
abe05a73 85 |
2c00a5a8 8677 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
abe05a73
XL
87 | ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
88
89error: this argument is passed by value, but not consumed in the function body
2c00a5a8 90 --> $DIR/needless_pass_by_value.rs:77:53
abe05a73 91 |
2c00a5a8 9277 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
abe05a73 93 | ^^^^^^^^
abe05a73
XL
94help: consider changing the type to
95 |
2c00a5a8 9677 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: &[i32]) {
abe05a73
XL
97 | ^^^^^^
98help: change `v.clone()` to
99 |
2c00a5a8 10081 | let _ = v.to_owned();
abe05a73
XL
101 | ^^^^^^^^^^^^
102
103error: this argument is passed by value, but not consumed in the function body
2c00a5a8 104 --> $DIR/needless_pass_by_value.rs:89:12
abe05a73 105 |
2c00a5a8 10689 | s: String,
abe05a73
XL
107 | ^^^^^^ help: consider changing the type to: `&str`
108
109error: this argument is passed by value, but not consumed in the function body
2c00a5a8 110 --> $DIR/needless_pass_by_value.rs:90:12
ea8adc8c 111 |
2c00a5a8 11290 | t: String,
abe05a73
XL
113 | ^^^^^^ help: consider taking a reference instead: `&String`
114
115error: this argument is passed by value, but not consumed in the function body
2c00a5a8 116 --> $DIR/needless_pass_by_value.rs:102:13
abe05a73 117 |
2c00a5a8 118102 | _u: U,
abe05a73 119 | ^ help: consider taking a reference instead: `&U`
ea8adc8c 120
abe05a73 121error: this argument is passed by value, but not consumed in the function body
2c00a5a8 122 --> $DIR/needless_pass_by_value.rs:103:13
abe05a73 123 |
2c00a5a8 124103 | _s: Self,
abe05a73 125 | ^^^^ help: consider taking a reference instead: `&Self`
ea8adc8c 126
2c00a5a8
XL
127error: this argument is passed by value, but not consumed in the function body
128 --> $DIR/needless_pass_by_value.rs:125:24
129 |
130125 | fn bar_copy(x: u32, y: CopyWrapper) {
131 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
132 |
133help: consider marking this type as Copy
134 --> $DIR/needless_pass_by_value.rs:123:1
135 |
136123 | struct CopyWrapper(u32);
137 | ^^^^^^^^^^^^^^^^^^^^^^^^
138
139error: this argument is passed by value, but not consumed in the function body
140 --> $DIR/needless_pass_by_value.rs:131:29
141 |
142131 | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
143 | ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
144 |
145help: consider marking this type as Copy
146 --> $DIR/needless_pass_by_value.rs:123:1
147 |
148123 | struct CopyWrapper(u32);
149 | ^^^^^^^^^^^^^^^^^^^^^^^^
150
151error: this argument is passed by value, but not consumed in the function body
152 --> $DIR/needless_pass_by_value.rs:131:45
153 |
154131 | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
155 | ^^^^^^^^^^^
156 |
157help: consider marking this type as Copy
158 --> $DIR/needless_pass_by_value.rs:123:1
159 |
160123 | struct CopyWrapper(u32);
161 | ^^^^^^^^^^^^^^^^^^^^^^^^
162help: consider taking a reference instead
163 |
164131 | fn test_destructure_copy(x: CopyWrapper, y: &CopyWrapper, z: CopyWrapper) {
165132 | let CopyWrapper(s) = z; // moved
166133 | let CopyWrapper(ref t) = *y; // not moved
167134 | let CopyWrapper(_) = *y; // still not moved
168 |
169
170error: this argument is passed by value, but not consumed in the function body
171 --> $DIR/needless_pass_by_value.rs:131:61
172 |
173131 | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
174 | ^^^^^^^^^^^
175 |
176help: consider marking this type as Copy
177 --> $DIR/needless_pass_by_value.rs:123:1
178 |
179123 | struct CopyWrapper(u32);
180 | ^^^^^^^^^^^^^^^^^^^^^^^^
181help: consider taking a reference instead
182 |
183131 | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: &CopyWrapper) {
184132 | let CopyWrapper(s) = *z; // moved
185 |
186
187error: aborting due to 20 previous errors
188