You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.structural2024.stderr
+20-15
Original file line number
Diff line number
Diff line change
@@ -10,10 +10,11 @@ note: matching on a reference type with a non-reference pattern changes the defa
10
10
|
11
11
LL | let [&ref x] = &[&0];
12
12
| ^^^^^^^^ this matches on type `&_`
13
-
help: make the implied reference pattern explicit
13
+
help: rewrite the pattern
14
+
|
15
+
LL - let [&ref x] = &[&0];
16
+
LL + let &[x] = &[&0];
14
17
|
15
-
LL | let &[&ref x] = &[&0];
16
-
| +
17
18
18
19
error: binding modifiers may only be written when the default binding mode is `move`
19
20
--> $DIR/ref-binding-on-inh-ref-errors.rs:20:11
@@ -27,10 +28,11 @@ note: matching on a reference type with a non-reference pattern changes the defa
27
28
|
28
29
LL | let [&ref x] = &mut [&0];
29
30
| ^^^^^^^^ this matches on type `&mut _`
30
-
help: make the implied reference pattern explicit
31
+
help: rewrite the pattern
32
+
|
33
+
LL - let [&ref x] = &mut [&0];
34
+
LL + let &mut [x] = &mut [&0];
31
35
|
32
-
LL | let &mut [&ref x] = &mut [&0];
33
-
| ++++
34
36
35
37
error: binding modifiers may only be written when the default binding mode is `move`
36
38
--> $DIR/ref-binding-on-inh-ref-errors.rs:25:15
@@ -61,10 +63,11 @@ note: matching on a reference type with a non-reference pattern changes the defa
61
63
|
62
64
LL | let [&mut ref mut x] = &mut [&mut 0];
63
65
| ^^^^^^^^^^^^^^^^ this matches on type `&mut _`
64
-
help: make the implied reference pattern explicit
66
+
help: rewrite the pattern
67
+
|
68
+
LL - let [&mut ref mut x] = &mut [&mut 0];
69
+
LL + let &mut [x] = &mut [&mut 0];
65
70
|
66
-
LL | let &mut [&mut ref mut x] = &mut [&mut 0];
67
-
| ++++
68
71
69
72
error: binding modifiers may only be written when the default binding mode is `move`
70
73
--> $DIR/ref-binding-on-inh-ref-errors.rs:39:11
@@ -78,10 +81,11 @@ note: matching on a reference type with a non-reference pattern changes the defa
78
81
|
79
82
LL | let [&ref x] = &[&mut 0];
80
83
| ^^^^^^^^ this matches on type `&_`
81
-
help: make the implied reference pattern explicit
84
+
help: rewrite the pattern
85
+
|
86
+
LL - let [&ref x] = &[&mut 0];
87
+
LL + let &[x] = &[&mut 0];
82
88
|
83
-
LL | let &[&ref x] = &[&mut 0];
84
-
| +
85
89
86
90
error: binding modifiers may only be written when the default binding mode is `move`
87
91
--> $DIR/ref-binding-on-inh-ref-errors.rs:45:11
@@ -95,10 +99,11 @@ note: matching on a reference type with a non-reference pattern changes the defa
95
99
|
96
100
LL | let [&ref x] = &mut [&mut 0];
97
101
| ^^^^^^^^ this matches on type `&mut _`
98
-
help: make the implied reference pattern explicit
102
+
help: rewrite the pattern
103
+
|
104
+
LL - let [&ref x] = &mut [&mut 0];
105
+
LL + let &mut [x] = &mut [&mut 0];
99
106
|
100
-
LL | let &mut [&ref x] = &mut [&mut 0];
101
-
| ++++
102
107
103
108
error: binding modifiers may only be written when the default binding mode is `move`
0 commit comments