File: ref-binding-on-inh-ref-errors.structural2024.stderr

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 934,128 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (196 lines) | stat: -rw-r--r-- 8,413 bytes parent folder | download | duplicates (8)
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:19:11
   |
LL |     let [&ref x] = &[&0];
   |           ^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:19:9
   |
LL |     let [&ref x] = &[&0];
   |         ^^^^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
   |
LL |     let &[&ref x] = &[&0];
   |         +

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:24:11
   |
LL |     let [&ref x] = &mut [&0];
   |           ^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:24:9
   |
LL |     let [&ref x] = &mut [&0];
   |         ^^^^^^^^ this matches on type `&mut _`
help: make the implied reference pattern explicit
   |
LL |     let &mut [&ref x] = &mut [&0];
   |         ++++

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:29:15
   |
LL |     let [&mut ref x] = &mut [&mut 0];
   |               ^^^ binding modifier not allowed under `ref mut` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:29:9
   |
LL |     let [&mut ref x] = &mut [&mut 0];
   |         ^^^^^^^^^^^^ this matches on type `&mut _`
help: make the implied reference pattern explicit
   |
LL |     let &mut [&mut ref x] = &mut [&mut 0];
   |         ++++

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:34:15
   |
LL |     let [&mut ref mut x] = &mut [&mut 0];
   |               ^^^^^^^ binding modifier not allowed under `ref mut` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:34:9
   |
LL |     let [&mut ref mut x] = &mut [&mut 0];
   |         ^^^^^^^^^^^^^^^^ this matches on type `&mut _`
help: make the implied reference pattern explicit
   |
LL |     let &mut [&mut ref mut x] = &mut [&mut 0];
   |         ++++

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:43:11
   |
LL |     let [&ref x] = &[&mut 0];
   |           ^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:43:9
   |
LL |     let [&ref x] = &[&mut 0];
   |         ^^^^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
   |
LL |     let &[&ref x] = &[&mut 0];
   |         +

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:50:11
   |
LL |     let [&ref x] = &mut [&mut 0];
   |           ^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:50:9
   |
LL |     let [&ref x] = &mut [&mut 0];
   |         ^^^^^^^^ this matches on type `&mut _`
help: make the implied reference pattern explicit
   |
LL |     let &mut [&ref x] = &mut [&mut 0];
   |         ++++

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:60:15
   |
LL |     let [&mut ref x] = &[&mut 0];
   |               ^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:60:9
   |
LL |     let [&mut ref x] = &[&mut 0];
   |         ^^^^^^^^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
   |
LL |     let &[&mut ref x] = &[&mut 0];
   |         +

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:10
   |
LL |     let [ref mut x] = &[0];
   |          ^^^^^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:9
   |
LL |     let [ref mut x] = &[0];
   |         ^^^^^^^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
   |
LL |     let &[ref mut x] = &[0];
   |         +

error[E0596]: cannot borrow data in a `&` reference as mutable
  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:10
   |
LL |     let [ref mut x] = &[0];
   |          ^^^^^^^^^ cannot borrow as mutable

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:81:10
   |
LL |     let [ref x] = &[0];
   |          ^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:81:9
   |
LL |     let [ref x] = &[0];
   |         ^^^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
   |
LL |     let &[ref x] = &[0];
   |         +

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:85:10
   |
LL |     let [ref x] = &mut [0];
   |          ^^^ binding modifier not allowed under `ref mut` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:85:9
   |
LL |     let [ref x] = &mut [0];
   |         ^^^^^^^ this matches on type `&mut _`
help: make the implied reference pattern explicit
   |
LL |     let &mut [ref x] = &mut [0];
   |         ++++

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:89:10
   |
LL |     let [ref mut x] = &mut [0];
   |          ^^^^^^^ binding modifier not allowed under `ref mut` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:89:9
   |
LL |     let [ref mut x] = &mut [0];
   |         ^^^^^^^^^^^ this matches on type `&mut _`
help: make the implied reference pattern explicit
   |
LL |     let &mut [ref mut x] = &mut [0];
   |         ++++

error: aborting due to 12 previous errors

For more information about this error, try `rustc --explain E0596`.