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.classic2024.stderr
+8-8
Original file line number
Diff line number
Diff line change
@@ -17,11 +17,11 @@ LL | let [ref mut x] = &[0];
17
17
| ^^^^^^^ binding modifier not allowed under `ref` default binding mode
18
18
|
19
19
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
20
-
note: the default binding mode changed to `ref` because this has type `&_`
20
+
note: matching on a reference type with a non-reference pattern changes the default binding mode
21
21
--> $DIR/ref-binding-on-inh-ref-errors.rs:67:9
22
22
|
23
23
LL | let [ref mut x] = &[0];
24
-
| ^^^^^^^^^^^ the default binding mode is `ref`, introduced here
24
+
| ^^^^^^^^^^^ this matches on type `&_`
25
25
help: make the implied reference pattern explicit
26
26
|
27
27
LL | let &[ref mut x] = &[0];
@@ -40,11 +40,11 @@ LL | let [ref x] = &[0];
40
40
| ^^^ binding modifier not allowed under `ref` default binding mode
41
41
|
42
42
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
43
-
note: the default binding mode changed to `ref` because this has type `&_`
43
+
note: matching on a reference type with a non-reference pattern changes the default binding mode
44
44
--> $DIR/ref-binding-on-inh-ref-errors.rs:75:9
45
45
|
46
46
LL | let [ref x] = &[0];
47
-
| ^^^^^^^ the default binding mode is `ref`, introduced here
47
+
| ^^^^^^^ this matches on type `&_`
48
48
help: make the implied reference pattern explicit
49
49
|
50
50
LL | let &[ref x] = &[0];
@@ -57,11 +57,11 @@ LL | let [ref x] = &mut [0];
57
57
| ^^^ binding modifier not allowed under `ref mut` default binding mode
58
58
|
59
59
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
60
-
note: the default binding mode changed to `ref mut` because this has type `&mut _`
60
+
note: matching on a reference type with a non-reference pattern changes the default binding mode
61
61
--> $DIR/ref-binding-on-inh-ref-errors.rs:79:9
62
62
|
63
63
LL | let [ref x] = &mut [0];
64
-
| ^^^^^^^ the default binding mode is `ref mut`, introduced here
Copy file name to clipboardexpand all lines: tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.structural2024.stderr
+22-22
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,11 @@ LL | let [&ref x] = &[&0];
5
5
| ^^^ binding modifier not allowed under `ref` default binding mode
6
6
|
7
7
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
8
-
note: the default binding mode changed to `ref` because this has type `&_`
8
+
note: matching on a reference type with a non-reference pattern changes the default binding mode
9
9
--> $DIR/ref-binding-on-inh-ref-errors.rs:15:9
10
10
|
11
11
LL | let [&ref x] = &[&0];
12
-
| ^^^^^^^^ the default binding mode is `ref`, introduced here
0 commit comments