]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_pass_by_value.stderr
Support non-moving usages at `match`
[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 help: ...and dereference it here
51    |     match *x {
52
53 error: this argument is passed by value, but not consumed in the function body
54   --> $DIR/needless_pass_by_value.rs:53:24
55    |
56 53 | fn test_destructure(x: Wrapper, y: Wrapper) {
57    |                        ^^^^^^^
58    |
59 help: consider taking a reference instead
60    | fn test_destructure(x: &Wrapper, y: Wrapper) {
61
62 error: aborting due to 6 previous errors
63