]> git.lizzy.rs Git - rust.git/blob - clippy_tests/examples/needless_pass_by_value.stderr
Fix the test suite after cargo update
[rust.git] / clippy_tests / examples / needless_pass_by_value.stderr
1 error: this argument is passed by value, but not consumed in the function body
2  --> 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   --> 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    = note: `-D needless-pass-by-value` implied by `-D warnings`
16
17 error: this argument is passed by value, but not consumed in the function body
18   --> needless_pass_by_value.rs:23:22
19    |
20 23 | fn bar(x: String, y: Wrapper) {
21    |                      ^^^^^^^ help: consider taking a reference instead `&Wrapper`
22    |
23    = note: `-D needless-pass-by-value` implied by `-D warnings`
24
25 error: this argument is passed by value, but not consumed in the function body
26   --> needless_pass_by_value.rs:29:63
27    |
28 29 | fn test_borrow_trait<T: std::borrow::Borrow<str>, U>(t: T, u: U) {
29    |                                                               ^ help: consider taking a reference instead `&U`
30    |
31    = note: `-D needless-pass-by-value` implied by `-D warnings`
32
33 error: this argument is passed by value, but not consumed in the function body
34   --> needless_pass_by_value.rs:40:18
35    |
36 40 | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
37    |                  ^^^^^^^^^^^^^^^^^^^^^^
38    |
39    = note: `-D needless-pass-by-value` implied by `-D warnings`
40 help: consider taking a reference instead
41    | fn test_match(x: &Option<Option<String>>, y: Option<Option<String>>) {
42    |     match *x {
43
44 error: this argument is passed by value, but not consumed in the function body
45   --> needless_pass_by_value.rs:53:24
46    |
47 53 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
48    |                        ^^^^^^^ help: consider taking a reference instead `&Wrapper`
49    |
50    = note: `-D needless-pass-by-value` implied by `-D warnings`
51
52 error: this argument is passed by value, but not consumed in the function body
53   --> needless_pass_by_value.rs:53:36
54    |
55 53 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
56    |                                    ^^^^^^^
57    |
58    = note: `-D needless-pass-by-value` implied by `-D warnings`
59 help: consider taking a reference instead
60    | fn test_destructure(x: Wrapper, y: &Wrapper, z: Wrapper) {
61    |     let Wrapper(s) = z; // moved
62    |     let Wrapper(ref t) = *y; // not moved
63    |     let Wrapper(_) = *y; // still not moved
64
65 error: aborting due to previous error(s)
66
67
68 To learn more, run the command again with --verbose.