]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_pass_by_value.stderr
Reduce the hackiness of cargo-clippy
[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:9:23
3   |
4 9 | 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:23:11
11    |
12 23 | 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:23:22
17    |
18 23 | 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:29:63
23    |
24 29 | fn test_borrow_trait<T: std::borrow::Borrow<str>, U>(t: T, u: U) {
25    |                                                               ^ help: consider taking a reference instead: `&U`
26
27 error: this argument is passed by value, but not consumed in the function body
28   --> $DIR/needless_pass_by_value.rs:40:18
29    |
30 40 | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
31    |                  ^^^^^^^^^^^^^^^^^^^^^^
32    |
33 help: consider taking a reference instead
34    |
35 40 | fn test_match(x: &Option<Option<String>>, y: Option<Option<String>>) {
36 41 |     match *x {
37    |
38
39 error: this argument is passed by value, but not consumed in the function body
40   --> $DIR/needless_pass_by_value.rs:53:24
41    |
42 53 | 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:53:36
47    |
48 53 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
49    |                                    ^^^^^^^
50    |
51 help: consider taking a reference instead
52    |
53 53 | fn test_destructure(x: Wrapper, y: &Wrapper, z: Wrapper) {
54 54 |     let Wrapper(s) = z; // moved
55 55 |     let Wrapper(ref t) = *y; // not moved
56 56 |     let Wrapper(_) = *y; // still not moved
57    |
58