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
+24-16Lines changed: 24 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -14,12 +14,14 @@ error: binding modifiers may only be written when the default binding mode is `m
14
14
--> $DIR/ref-binding-on-inh-ref-errors.rs:67:10
15
15
|
16
16
LL | let [ref mut x] = &[0];
17
-
| -^^^^^^^---
18
-
| ||
19
-
| |this binding modifier
20
-
| default binding mode is `ref`
17
+
| ^^^^^^^ binding modifier not allowed under `ref` default binding mode
21
18
|
22
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 `&_`
21
+
--> $DIR/ref-binding-on-inh-ref-errors.rs:67:9
22
+
|
23
+
LL | let [ref mut x] = &[0];
24
+
| ^^^^^^^^^^^ the default binding mode is `ref`, introduced here
23
25
help: make the implied reference pattern explicit
24
26
|
25
27
LL | let &[ref mut x] = &[0];
@@ -35,12 +37,14 @@ error: binding modifiers may only be written when the default binding mode is `m
35
37
--> $DIR/ref-binding-on-inh-ref-errors.rs:75:10
36
38
|
37
39
LL | let [ref x] = &[0];
38
-
| -^^^---
39
-
| ||
40
-
| |this binding modifier
41
-
| default binding mode is `ref`
40
+
| ^^^ binding modifier not allowed under `ref` default binding mode
42
41
|
43
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 `&_`
44
+
--> $DIR/ref-binding-on-inh-ref-errors.rs:75:9
45
+
|
46
+
LL | let [ref x] = &[0];
47
+
| ^^^^^^^ the default binding mode is `ref`, introduced here
44
48
help: make the implied reference pattern explicit
45
49
|
46
50
LL | let &[ref x] = &[0];
@@ -50,12 +54,14 @@ error: binding modifiers may only be written when the default binding mode is `m
50
54
--> $DIR/ref-binding-on-inh-ref-errors.rs:79:10
51
55
|
52
56
LL | let [ref x] = &mut [0];
53
-
| -^^^---
54
-
| ||
55
-
| |this binding modifier
56
-
| default binding mode is `ref mut`
57
+
| ^^^ binding modifier not allowed under `ref mut` default binding mode
57
58
|
58
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 _`
61
+
--> $DIR/ref-binding-on-inh-ref-errors.rs:79:9
62
+
|
63
+
LL | let [ref x] = &mut [0];
64
+
| ^^^^^^^ the default binding mode is `ref mut`, introduced here
59
65
help: make the implied reference pattern explicit
60
66
|
61
67
LL | let &mut [ref x] = &mut [0];
@@ -65,12 +71,14 @@ error: binding modifiers may only be written when the default binding mode is `m
65
71
--> $DIR/ref-binding-on-inh-ref-errors.rs:83:10
66
72
|
67
73
LL | let [ref mut x] = &mut [0];
68
-
| -^^^^^^^---
69
-
| ||
70
-
| |this binding modifier
71
-
| default binding mode is `ref mut`
74
+
| ^^^^^^^ binding modifier not allowed under `ref mut` default binding mode
72
75
|
73
76
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
77
+
note: the default binding mode changed to `ref mut` because this has type `&mut _`
78
+
--> $DIR/ref-binding-on-inh-ref-errors.rs:83:9
79
+
|
80
+
LL | let [ref mut x] = &mut [0];
81
+
| ^^^^^^^^^^^ the default binding mode is `ref mut`, introduced here
0 commit comments