blob: 6e8b43a3e52a5d56547230e770cd932b6a6a1bf5 (
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
89
90
91
92
93
94
|
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: to override `-D warnings` add `#[allow(clippy::ref_binding_to_reference)]`
help: try
|
LL | Some(x) => &x,
| ~ ~~
error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:39:14
|
LL | Some(ref x) => {
| ^^^^^
|
help: try
|
LL ~ Some(x) => {
LL |
LL | f1(x);
LL ~ f1(x);
LL ~ &x
|
error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:50:14
|
LL | Some(ref x) => m2!(x),
| ^^^^^
|
help: try
|
LL | Some(x) => m2!(&x),
| ~ ~~
error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:56:15
|
LL | let _ = |&ref x: &&String| {
| ^^^^^
|
help: try
|
LL ~ let _ = |&x: &&String| {
LL |
LL ~ let _: &&String = &x;
|
error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:63:12
|
LL | fn f2<'a>(&ref x: &&'a String) -> &'a String {
| ^^^^^
|
help: try
|
LL ~ fn f2<'a>(&x: &&'a String) -> &'a String {
LL |
LL ~ let _: &&String = &x;
LL ~ x
|
error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:71:11
|
LL | fn f(&ref x: &&String) {
| ^^^^^
|
help: try
|
LL ~ fn f(&x: &&String) {
LL |
LL ~ let _: &&String = &x;
|
error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:80:11
|
LL | fn f(&ref x: &&String) {
| ^^^^^
|
help: try
|
LL ~ fn f(&x: &&String) {
LL |
LL ~ let _: &&String = &x;
|
error: aborting due to 7 previous errors
|