summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/ref_binding_to_reference.stderr
blob: eb36cd516a246a9e4f581b7079efb0bacc8cc09d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
error: this pattern creates a reference to a reference
  --> $DIR/ref_binding_to_reference.rs:31:14
   |
LL |         Some(ref x) => x,
   |              ^^^^^
   |
   = note: `-D clippy::ref-binding-to-reference` implied by `-D warnings`
help: try this
   |
LL |         Some(x) => &x,
   |              ~     ~~

error: this pattern creates a reference to a reference
  --> $DIR/ref_binding_to_reference.rs:37:14
   |
LL |         Some(ref x) => {
   |              ^^^^^
   |
help: try this
   |
LL ~         Some(x) => {
LL |             f1(x);
LL ~             f1(x);
LL ~             &x
   |

error: this pattern creates a reference to a reference
  --> $DIR/ref_binding_to_reference.rs:47:14
   |
LL |         Some(ref x) => m2!(x),
   |              ^^^^^
   |
help: try this
   |
LL |         Some(x) => m2!(&x),
   |              ~         ~~

error: this pattern creates a reference to a reference
  --> $DIR/ref_binding_to_reference.rs:52:15
   |
LL |     let _ = |&ref x: &&String| {
   |               ^^^^^
   |
help: try this
   |
LL ~     let _ = |&x: &&String| {
LL ~         let _: &&String = &x;
   |

error: this pattern creates a reference to a reference
  --> $DIR/ref_binding_to_reference.rs:58:12
   |
LL | fn f2<'a>(&ref x: &&'a String) -> &'a String {
   |            ^^^^^
   |
help: try this
   |
LL ~ fn f2<'a>(&x: &&'a String) -> &'a String {
LL ~     let _: &&String = &x;
LL ~     x
   |

error: this pattern creates a reference to a reference
  --> $DIR/ref_binding_to_reference.rs:65:11
   |
LL |     fn f(&ref x: &&String) {
   |           ^^^^^
   |
help: try this
   |
LL ~     fn f(&x: &&String) {
LL ~         let _: &&String = &x;
   |

error: this pattern creates a reference to a reference
  --> $DIR/ref_binding_to_reference.rs:73:11
   |
LL |     fn f(&ref x: &&String) {
   |           ^^^^^
   |
help: try this
   |
LL ~     fn f(&x: &&String) {
LL ~         let _: &&String = &x;
   |

error: aborting due to 7 previous errors