]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_pass_by_value.stderr
Integrate suggestion spans
[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   |                       ^^^^^^
6   |
7 note: lint level defined here
8  --> $DIR/needless_pass_by_value.rs:4:9
9   |
10 4 | #![deny(needless_pass_by_value)]
11   |         ^^^^^^^^^^^^^^^^^^^^^^
12 help: consider changing the type to `&[T]`
13   | fn foo<T: Default>(v: &[T], w: Vec<T>, mut x: Vec<T>, y: Vec<T>) -> Vec<T> {
14
15 error: this argument is passed by value, but not consumed in the function body
16   --> $DIR/needless_pass_by_value.rs:23:11
17    |
18 23 | fn bar(x: String, y: Wrapper) {
19    |           ^^^^^^
20    |
21 help: consider changing the type to `&str`
22    | fn bar(x: &str, y: Wrapper) {
23
24 error: this argument is passed by value, but not consumed in the function body
25   --> $DIR/needless_pass_by_value.rs:23:22
26    |
27 23 | fn bar(x: String, y: Wrapper) {
28    |                      ^^^^^^^
29    |
30 help: consider taking a reference instead
31    | fn bar(x: String, y: &Wrapper) {
32
33 error: this argument is passed by value, but not consumed in the function body
34   --> $DIR/needless_pass_by_value.rs:29:63
35    |
36 29 | fn test_borrow_trait<T: std::borrow::Borrow<str>, U>(t: T, u: U) {
37    |                                                               ^
38    |
39 help: consider taking a reference instead
40    | fn test_borrow_trait<T: std::borrow::Borrow<str>, U>(t: T, u: &U) {
41
42 error: this argument is passed by value, but not consumed in the function body
43   --> $DIR/needless_pass_by_value.rs:40:18
44    |
45 40 | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
46    |                  ^^^^^^^^^^^^^^^^^^^^^^
47    |
48 help: consider taking a reference instead
49    | fn test_match(x: &Option<Option<String>>, y: Option<Option<String>>) {
50    |     match *x {
51
52 error: this argument is passed by value, but not consumed in the function body
53   --> $DIR/needless_pass_by_value.rs:53:24
54    |
55 53 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
56    |                        ^^^^^^^
57    |
58 help: consider taking a reference instead
59    | fn test_destructure(x: &Wrapper, y: Wrapper, z: Wrapper) {
60
61 error: this argument is passed by value, but not consumed in the function body
62   --> $DIR/needless_pass_by_value.rs:53:36
63    |
64 53 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
65    |                                    ^^^^^^^
66    |
67 help: consider taking a reference instead
68    | fn test_destructure(x: Wrapper, y: &Wrapper, z: Wrapper) {
69    |     let Wrapper(s) = z; // moved
70    |     let Wrapper(ref t) = *y; // not moved
71    |     let Wrapper(_) = *y; // still not moved
72
73 error: aborting due to 7 previous errors
74