]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/needless_borrow_pat.stderr
Rollup merge of #102625 - Rageking8:fix-backtrace-small-typo, r=m-ou-se
[rust.git] / src / tools / clippy / tests / ui / needless_borrow_pat.stderr
1 error: this pattern creates a reference to a reference
2   --> $DIR/needless_borrow_pat.rs:59:14
3    |
4 LL |         Some(ref x) => x,
5    |              ^^^^^ help: try this: `x`
6    |
7    = note: `-D clippy::needless-borrow` implied by `-D warnings`
8
9 error: this pattern creates a reference to a reference
10   --> $DIR/needless_borrow_pat.rs:65:14
11    |
12 LL |         Some(ref x) => *x,
13    |              ^^^^^
14    |
15 help: try this
16    |
17 LL |         Some(x) => x,
18    |              ~     ~
19
20 error: this pattern creates a reference to a reference
21   --> $DIR/needless_borrow_pat.rs:71:14
22    |
23 LL |         Some(ref x) => {
24    |              ^^^^^
25    |
26 help: try this
27    |
28 LL ~         Some(x) => {
29 LL |             f1(x);
30 LL ~             f1(x);
31    |
32
33 error: this pattern creates a reference to a reference
34   --> $DIR/needless_borrow_pat.rs:81:14
35    |
36 LL |         Some(ref x) => m1!(x),
37    |              ^^^^^ help: try this: `x`
38
39 error: this pattern creates a reference to a reference
40   --> $DIR/needless_borrow_pat.rs:86:15
41    |
42 LL |     let _ = |&ref x: &&String| {
43    |               ^^^^^ help: try this: `x`
44
45 error: this pattern creates a reference to a reference
46   --> $DIR/needless_borrow_pat.rs:91:10
47    |
48 LL |     let (ref y,) = (&x,);
49    |          ^^^^^
50    |
51 help: try this
52    |
53 LL ~     let (y,) = (&x,);
54 LL ~     let _: &String = y;
55    |
56
57 error: this pattern creates a reference to a reference
58   --> $DIR/needless_borrow_pat.rs:101:14
59    |
60 LL |         Some(ref x) => x.0,
61    |              ^^^^^ help: try this: `x`
62
63 error: this pattern creates a reference to a reference
64   --> $DIR/needless_borrow_pat.rs:111:14
65    |
66 LL |         E::A(ref x) | E::B(ref x) => *x,
67    |              ^^^^^         ^^^^^
68    |
69 help: try this
70    |
71 LL |         E::A(x) | E::B(x) => x,
72    |              ~         ~     ~
73
74 error: this pattern creates a reference to a reference
75   --> $DIR/needless_borrow_pat.rs:117:21
76    |
77 LL |         if let Some(ref x) = Some(&String::new());
78    |                     ^^^^^ help: try this: `x`
79
80 error: this pattern creates a reference to a reference
81   --> $DIR/needless_borrow_pat.rs:125:12
82    |
83 LL | fn f2<'a>(&ref x: &&'a String) -> &'a String {
84    |            ^^^^^
85    |
86 help: try this
87    |
88 LL ~ fn f2<'a>(&x: &&'a String) -> &'a String {
89 LL |     let _: &String = x;
90 LL ~     x
91    |
92
93 error: this pattern creates a reference to a reference
94   --> $DIR/needless_borrow_pat.rs:132:11
95    |
96 LL |     fn f(&ref x: &&String) {
97    |           ^^^^^ help: try this: `x`
98
99 error: this pattern creates a reference to a reference
100   --> $DIR/needless_borrow_pat.rs:140:11
101    |
102 LL |     fn f(&ref x: &&String) {
103    |           ^^^^^
104    |
105 help: try this
106    |
107 LL ~     fn f(&x: &&String) {
108 LL ~         let _: &String = x;
109    |
110
111 error: aborting due to 12 previous errors
112