@@ -6,11 +6,11 @@ LL | let Foo(mut x) = &Foo(0);
6
6
|
7
7
= warning: this changes meaning in Rust 2024
8
8
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
9
- note: the default binding mode changed to `ref` because this has type `&_`
9
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
10
10
--> $DIR/migration_lint.rs:25:9
11
11
|
12
12
LL | let Foo(mut x) = &Foo(0);
13
- | ^^^^^^^^^^ the default binding mode is `ref`, introduced here
13
+ | ^^^^^^^^^^ this matches on type `&_`
14
14
note: the lint level is defined here
15
15
--> $DIR/migration_lint.rs:7:9
16
16
|
@@ -29,11 +29,11 @@ LL | let Foo(mut x) = &mut Foo(0);
29
29
|
30
30
= warning: this changes meaning in Rust 2024
31
31
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
32
- note: the default binding mode changed to `ref mut` because this has type `&mut _`
32
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
33
33
--> $DIR/migration_lint.rs:30:9
34
34
|
35
35
LL | let Foo(mut x) = &mut Foo(0);
36
- | ^^^^^^^^^^ the default binding mode is `ref mut`, introduced here
36
+ | ^^^^^^^^^^ this matches on type `& mut _`
37
37
help: make the implied reference pattern explicit
38
38
|
39
39
LL | let &mut Foo(mut x) = &mut Foo(0);
@@ -47,11 +47,11 @@ LL | let Foo(ref x) = &Foo(0);
47
47
|
48
48
= warning: this changes meaning in Rust 2024
49
49
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
50
- note: the default binding mode changed to `ref` because this has type `&_`
50
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
51
51
--> $DIR/migration_lint.rs:35:9
52
52
|
53
53
LL | let Foo(ref x) = &Foo(0);
54
- | ^^^^^^^^^^ the default binding mode is `ref`, introduced here
54
+ | ^^^^^^^^^^ this matches on type `&_`
55
55
help: make the implied reference pattern explicit
56
56
|
57
57
LL | let &Foo(ref x) = &Foo(0);
@@ -65,11 +65,11 @@ LL | let Foo(ref x) = &mut Foo(0);
65
65
|
66
66
= warning: this changes meaning in Rust 2024
67
67
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
68
- note: the default binding mode changed to `ref mut` because this has type `&mut _`
68
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
69
69
--> $DIR/migration_lint.rs:40:9
70
70
|
71
71
LL | let Foo(ref x) = &mut Foo(0);
72
- | ^^^^^^^^^^ the default binding mode is `ref mut`, introduced here
72
+ | ^^^^^^^^^^ this matches on type `& mut _`
73
73
help: make the implied reference pattern explicit
74
74
|
75
75
LL | let &mut Foo(ref x) = &mut Foo(0);
@@ -83,11 +83,11 @@ LL | let Foo(&x) = &Foo(&0);
83
83
|
84
84
= warning: this changes meaning in Rust 2024
85
85
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
86
- note: the default binding mode changed to `ref` because this has type `&_`
86
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
87
87
--> $DIR/migration_lint.rs:57:9
88
88
|
89
89
LL | let Foo(&x) = &Foo(&0);
90
- | ^^^^^^^ the default binding mode is `ref`, introduced here
90
+ | ^^^^^^^ this matches on type `&_`
91
91
help: make the implied reference pattern explicit
92
92
|
93
93
LL | let &Foo(&x) = &Foo(&0);
@@ -101,11 +101,11 @@ LL | let Foo(&mut x) = &Foo(&mut 0);
101
101
|
102
102
= warning: this changes meaning in Rust 2024
103
103
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
104
- note: the default binding mode changed to `ref` because this has type `&_`
104
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
105
105
--> $DIR/migration_lint.rs:62:9
106
106
|
107
107
LL | let Foo(&mut x) = &Foo(&mut 0);
108
- | ^^^^^^^^^^^ the default binding mode is `ref`, introduced here
108
+ | ^^^^^^^^^^^ this matches on type `&_`
109
109
help: make the implied reference pattern explicit
110
110
|
111
111
LL | let &Foo(&mut x) = &Foo(&mut 0);
@@ -119,11 +119,11 @@ LL | let Foo(&x) = &mut Foo(&0);
119
119
|
120
120
= warning: this changes meaning in Rust 2024
121
121
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
122
- note: the default binding mode changed to `ref mut` because this has type `&mut _`
122
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
123
123
--> $DIR/migration_lint.rs:67:9
124
124
|
125
125
LL | let Foo(&x) = &mut Foo(&0);
126
- | ^^^^^^^ the default binding mode is `ref mut`, introduced here
126
+ | ^^^^^^^ this matches on type `& mut _`
127
127
help: make the implied reference pattern explicit
128
128
|
129
129
LL | let &mut Foo(&x) = &mut Foo(&0);
@@ -137,11 +137,11 @@ LL | let Foo(&mut x) = &mut Foo(&mut 0);
137
137
|
138
138
= warning: this changes meaning in Rust 2024
139
139
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
140
- note: the default binding mode changed to `ref mut` because this has type `&mut _`
140
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
141
141
--> $DIR/migration_lint.rs:72:9
142
142
|
143
143
LL | let Foo(&mut x) = &mut Foo(&mut 0);
144
- | ^^^^^^^^^^^ the default binding mode is `ref mut`, introduced here
144
+ | ^^^^^^^^^^^ this matches on type `& mut _`
145
145
help: make the implied reference pattern explicit
146
146
|
147
147
LL | let &mut Foo(&mut x) = &mut Foo(&mut 0);
@@ -155,11 +155,11 @@ LL | if let Some(&x) = &&&&&Some(&0u8) {
155
155
|
156
156
= warning: this changes meaning in Rust 2024
157
157
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
158
- note: the default binding mode changed to `ref` because this has type `&_`
158
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
159
159
--> $DIR/migration_lint.rs:81:12
160
160
|
161
161
LL | if let Some(&x) = &&&&&Some(&0u8) {
162
- | ^^^^^^^^ the default binding mode is `ref`, introduced here
162
+ | ^^^^^^^^ this matches on type `&_`
163
163
help: make the implied reference patterns explicit
164
164
|
165
165
LL | if let &&&&&Some(&x) = &&&&&Some(&0u8) {
@@ -173,11 +173,11 @@ LL | if let Some(&mut x) = &&&&&Some(&mut 0u8) {
173
173
|
174
174
= warning: this changes meaning in Rust 2024
175
175
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
176
- note: the default binding mode changed to `ref` because this has type `&_`
176
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
177
177
--> $DIR/migration_lint.rs:87:12
178
178
|
179
179
LL | if let Some(&mut x) = &&&&&Some(&mut 0u8) {
180
- | ^^^^^^^^^^^^ the default binding mode is `ref`, introduced here
180
+ | ^^^^^^^^^^^^ this matches on type `&_`
181
181
help: make the implied reference patterns explicit
182
182
|
183
183
LL | if let &&&&&Some(&mut x) = &&&&&Some(&mut 0u8) {
@@ -191,11 +191,11 @@ LL | if let Some(&x) = &&&&&mut Some(&0u8) {
191
191
|
192
192
= warning: this changes meaning in Rust 2024
193
193
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
194
- note: the default binding mode changed to `ref` because this has type `&_`
194
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
195
195
--> $DIR/migration_lint.rs:93:12
196
196
|
197
197
LL | if let Some(&x) = &&&&&mut Some(&0u8) {
198
- | ^^^^^^^^ the default binding mode is `ref`, introduced here
198
+ | ^^^^^^^^ this matches on type `&_`
199
199
help: make the implied reference patterns explicit
200
200
|
201
201
LL | if let &&&&&mut Some(&x) = &&&&&mut Some(&0u8) {
@@ -209,11 +209,11 @@ LL | if let Some(&mut Some(Some(x))) = &mut Some(&mut Some(&mut Some(0u8)))
209
209
|
210
210
= warning: this changes meaning in Rust 2024
211
211
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
212
- note: the default binding mode changed to `ref mut` because this has type `&mut _`
212
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
213
213
--> $DIR/migration_lint.rs:99:12
214
214
|
215
215
LL | if let Some(&mut Some(Some(x))) = &mut Some(&mut Some(&mut Some(0u8))) {
216
- | ^^^^^^^^^^^^^^^^^^^^^^^^ the default binding mode is `ref mut`, introduced here
216
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `& mut _`
217
217
help: make the implied reference patterns and variable binding mode explicit
218
218
|
219
219
LL | if let &mut Some(&mut Some(&mut Some(ref mut x))) = &mut Some(&mut Some(&mut Some(0u8))) {
@@ -227,11 +227,11 @@ LL | let Struct { a, mut b, c } = &Struct { a: 0, b: 0, c: 0 };
227
227
|
228
228
= warning: this changes meaning in Rust 2024
229
229
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
230
- note: the default binding mode changed to `ref` because this has type `&_`
230
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
231
231
--> $DIR/migration_lint.rs:111:9
232
232
|
233
233
LL | let Struct { a, mut b, c } = &Struct { a: 0, b: 0, c: 0 };
234
- | ^^^^^^^^^^^^^^^^^^^^^^ the default binding mode is `ref`, introduced here
234
+ | ^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
235
235
help: make the implied reference pattern and variable binding modes explicit
236
236
|
237
237
LL | let &Struct { ref a, mut b, ref c } = &Struct { a: 0, b: 0, c: 0 };
@@ -247,11 +247,11 @@ LL | let Struct { a: &a, b, ref c } = &Struct { a: &0, b: &0, c: &0 };
247
247
|
248
248
= warning: this changes meaning in Rust 2024
249
249
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
250
- note: the default binding mode changed to `ref` because this has type `&_`
250
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
251
251
--> $DIR/migration_lint.rs:117:9
252
252
|
253
253
LL | let Struct { a: &a, b, ref c } = &Struct { a: &0, b: &0, c: &0 };
254
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the default binding mode is `ref`, introduced here
254
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
255
255
help: make the implied reference pattern and variable binding mode explicit
256
256
|
257
257
LL | let &Struct { a: &a, ref b, ref c } = &Struct { a: &0, b: &0, c: &0 };
@@ -267,11 +267,11 @@ LL | if let Struct { a: &Some(a), b: Some(&b), c: Some(c) } =
267
267
|
268
268
= warning: this changes meaning in Rust 2024
269
269
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
270
- note: the default binding mode changed to `ref` because this has type `&_`
270
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
271
271
--> $DIR/migration_lint.rs:124:12
272
272
|
273
273
LL | if let Struct { a: &Some(a), b: Some(&b), c: Some(c) } =
274
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the default binding mode is `ref`, introduced here
274
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
275
275
help: make the implied reference patterns and variable binding mode explicit
276
276
|
277
277
LL | if let &Struct { a: &Some(a), b: &Some(&b), c: &Some(ref c) } =
@@ -286,11 +286,11 @@ LL | (Some(mut x), migration_lint_macros::mixed_edition_pat!(y)) => {
286
286
| binding modifier not allowed under `ref` default binding mode
287
287
|
288
288
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
289
- note: the default binding mode changed to `ref` because this has type `&_`
289
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
290
290
--> $DIR/migration_lint.rs:137:9
291
291
|
292
292
LL | (Some(mut x), migration_lint_macros::mixed_edition_pat!(y)) => {
293
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the default binding mode is `ref`, introduced here
293
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
294
294
= note: this error originates in the macro `migration_lint_macros::mixed_edition_pat` (in Nightly builds, run with -Z macro-backtrace for more info)
295
295
help: make the implied reference pattern explicit
296
296
|
@@ -307,16 +307,16 @@ LL | let [&mut [ref a]] = &mut [&mut &[0]];
307
307
|
308
308
= warning: this changes meaning in Rust 2024
309
309
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
310
- note: the default binding mode changed to `ref` because this has type `&_`
310
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
311
311
--> $DIR/migration_lint.rs:145:15
312
312
|
313
313
LL | let [&mut [ref a]] = &mut [&mut &[0]];
314
- | ^^^^^^^ the default binding mode is `ref`, introduced here
315
- note: the default binding mode changed to `ref mut` because this has type `&mut _`
314
+ | ^^^^^^^ this matches on type `&_`
315
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
316
316
--> $DIR/migration_lint.rs:145:9
317
317
|
318
318
LL | let [&mut [ref a]] = &mut [&mut &[0]];
319
- | ^^^^^^^^^^^^^^ the default binding mode is `ref mut`, introduced here
319
+ | ^^^^^^^^^^^^^^ this matches on type `& mut _`
320
320
help: make the implied reference patterns explicit
321
321
|
322
322
LL | let &mut [&mut &[ref a]] = &mut [&mut &[0]];
@@ -330,11 +330,11 @@ LL | let [&(_)] = &[&0];
330
330
|
331
331
= warning: this changes meaning in Rust 2024
332
332
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
333
- note: the default binding mode changed to `ref` because this has type `&_`
333
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
334
334
--> $DIR/migration_lint.rs:150:9
335
335
|
336
336
LL | let [&(_)] = &[&0];
337
- | ^^^^^^ the default binding mode is `ref`, introduced here
337
+ | ^^^^^^ this matches on type `&_`
338
338
help: make the implied reference pattern explicit
339
339
|
340
340
LL | let &[&(_)] = &[&0];
0 commit comments