@@ -6,11 +6,11 @@ LL | let Foo(mut x) = &Foo(0);
66 |
77 = warning: this changes meaning in Rust 2024
88 = 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
1010 --> $DIR/migration_lint.rs:25:9
1111 |
1212LL | let Foo(mut x) = &Foo(0);
13- | ^^^^^^^^^^ the default binding mode is `ref`, introduced here
13+ | ^^^^^^^^^^ this matches on type `&_`
1414note: the lint level is defined here
1515 --> $DIR/migration_lint.rs:7:9
1616 |
@@ -29,11 +29,11 @@ LL | let Foo(mut x) = &mut Foo(0);
2929 |
3030 = warning: this changes meaning in Rust 2024
3131 = 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
3333 --> $DIR/migration_lint.rs:30:9
3434 |
3535LL | let Foo(mut x) = &mut Foo(0);
36- | ^^^^^^^^^^ the default binding mode is `ref mut`, introduced here
36+ | ^^^^^^^^^^ this matches on type `& mut _`
3737help: make the implied reference pattern explicit
3838 |
3939LL | let &mut Foo(mut x) = &mut Foo(0);
@@ -47,11 +47,11 @@ LL | let Foo(ref x) = &Foo(0);
4747 |
4848 = warning: this changes meaning in Rust 2024
4949 = 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
5151 --> $DIR/migration_lint.rs:35:9
5252 |
5353LL | let Foo(ref x) = &Foo(0);
54- | ^^^^^^^^^^ the default binding mode is `ref`, introduced here
54+ | ^^^^^^^^^^ this matches on type `&_`
5555help: make the implied reference pattern explicit
5656 |
5757LL | let &Foo(ref x) = &Foo(0);
@@ -65,11 +65,11 @@ LL | let Foo(ref x) = &mut Foo(0);
6565 |
6666 = warning: this changes meaning in Rust 2024
6767 = 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
6969 --> $DIR/migration_lint.rs:40:9
7070 |
7171LL | let Foo(ref x) = &mut Foo(0);
72- | ^^^^^^^^^^ the default binding mode is `ref mut`, introduced here
72+ | ^^^^^^^^^^ this matches on type `& mut _`
7373help: make the implied reference pattern explicit
7474 |
7575LL | let &mut Foo(ref x) = &mut Foo(0);
@@ -83,11 +83,11 @@ LL | let Foo(&x) = &Foo(&0);
8383 |
8484 = warning: this changes meaning in Rust 2024
8585 = 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
8787 --> $DIR/migration_lint.rs:57:9
8888 |
8989LL | let Foo(&x) = &Foo(&0);
90- | ^^^^^^^ the default binding mode is `ref`, introduced here
90+ | ^^^^^^^ this matches on type `&_`
9191help: make the implied reference pattern explicit
9292 |
9393LL | let &Foo(&x) = &Foo(&0);
@@ -101,11 +101,11 @@ LL | let Foo(&mut x) = &Foo(&mut 0);
101101 |
102102 = warning: this changes meaning in Rust 2024
103103 = 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
105105 --> $DIR/migration_lint.rs:62:9
106106 |
107107LL | let Foo(&mut x) = &Foo(&mut 0);
108- | ^^^^^^^^^^^ the default binding mode is `ref`, introduced here
108+ | ^^^^^^^^^^^ this matches on type `&_`
109109help: make the implied reference pattern explicit
110110 |
111111LL | let &Foo(&mut x) = &Foo(&mut 0);
@@ -119,11 +119,11 @@ LL | let Foo(&x) = &mut Foo(&0);
119119 |
120120 = warning: this changes meaning in Rust 2024
121121 = 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
123123 --> $DIR/migration_lint.rs:67:9
124124 |
125125LL | let Foo(&x) = &mut Foo(&0);
126- | ^^^^^^^ the default binding mode is `ref mut`, introduced here
126+ | ^^^^^^^ this matches on type `& mut _`
127127help: make the implied reference pattern explicit
128128 |
129129LL | let &mut Foo(&x) = &mut Foo(&0);
@@ -137,11 +137,11 @@ LL | let Foo(&mut x) = &mut Foo(&mut 0);
137137 |
138138 = warning: this changes meaning in Rust 2024
139139 = 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
141141 --> $DIR/migration_lint.rs:72:9
142142 |
143143LL | let Foo(&mut x) = &mut Foo(&mut 0);
144- | ^^^^^^^^^^^ the default binding mode is `ref mut`, introduced here
144+ | ^^^^^^^^^^^ this matches on type `& mut _`
145145help: make the implied reference pattern explicit
146146 |
147147LL | let &mut Foo(&mut x) = &mut Foo(&mut 0);
@@ -155,11 +155,11 @@ LL | if let Some(&x) = &&&&&Some(&0u8) {
155155 |
156156 = warning: this changes meaning in Rust 2024
157157 = 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
159159 --> $DIR/migration_lint.rs:81:12
160160 |
161161LL | if let Some(&x) = &&&&&Some(&0u8) {
162- | ^^^^^^^^ the default binding mode is `ref`, introduced here
162+ | ^^^^^^^^ this matches on type `&_`
163163help: make the implied reference patterns explicit
164164 |
165165LL | if let &&&&&Some(&x) = &&&&&Some(&0u8) {
@@ -173,11 +173,11 @@ LL | if let Some(&mut x) = &&&&&Some(&mut 0u8) {
173173 |
174174 = warning: this changes meaning in Rust 2024
175175 = 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
177177 --> $DIR/migration_lint.rs:87:12
178178 |
179179LL | if let Some(&mut x) = &&&&&Some(&mut 0u8) {
180- | ^^^^^^^^^^^^ the default binding mode is `ref`, introduced here
180+ | ^^^^^^^^^^^^ this matches on type `&_`
181181help: make the implied reference patterns explicit
182182 |
183183LL | if let &&&&&Some(&mut x) = &&&&&Some(&mut 0u8) {
@@ -191,11 +191,11 @@ LL | if let Some(&x) = &&&&&mut Some(&0u8) {
191191 |
192192 = warning: this changes meaning in Rust 2024
193193 = 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
195195 --> $DIR/migration_lint.rs:93:12
196196 |
197197LL | if let Some(&x) = &&&&&mut Some(&0u8) {
198- | ^^^^^^^^ the default binding mode is `ref`, introduced here
198+ | ^^^^^^^^ this matches on type `&_`
199199help: make the implied reference patterns explicit
200200 |
201201LL | 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)))
209209 |
210210 = warning: this changes meaning in Rust 2024
211211 = 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
213213 --> $DIR/migration_lint.rs:99:12
214214 |
215215LL | 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 _`
217217help: make the implied reference patterns and variable binding mode explicit
218218 |
219219LL | 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 };
227227 |
228228 = warning: this changes meaning in Rust 2024
229229 = 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
231231 --> $DIR/migration_lint.rs:111:9
232232 |
233233LL | 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 `&_`
235235help: make the implied reference pattern and variable binding modes explicit
236236 |
237237LL | 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 };
247247 |
248248 = warning: this changes meaning in Rust 2024
249249 = 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
251251 --> $DIR/migration_lint.rs:117:9
252252 |
253253LL | 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 `&_`
255255help: make the implied reference pattern and variable binding mode explicit
256256 |
257257LL | 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) } =
267267 |
268268 = warning: this changes meaning in Rust 2024
269269 = 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
271271 --> $DIR/migration_lint.rs:124:12
272272 |
273273LL | 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 `&_`
275275help: make the implied reference patterns and variable binding mode explicit
276276 |
277277LL | 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)) => {
286286 | binding modifier not allowed under `ref` default binding mode
287287 |
288288 = 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
290290 --> $DIR/migration_lint.rs:137:9
291291 |
292292LL | (Some(mut x), migration_lint_macros::mixed_edition_pat!(y)) => {
293- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the default binding mode is `ref`, introduced here
293+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
294294 = note: this error originates in the macro `migration_lint_macros::mixed_edition_pat` (in Nightly builds, run with -Z macro-backtrace for more info)
295295help: make the implied reference pattern explicit
296296 |
@@ -307,16 +307,16 @@ LL | let [&mut [ref a]] = &mut [&mut &[0]];
307307 |
308308 = warning: this changes meaning in Rust 2024
309309 = 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
311311 --> $DIR/migration_lint.rs:145:15
312312 |
313313LL | 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
316316 --> $DIR/migration_lint.rs:145:9
317317 |
318318LL | let [&mut [ref a]] = &mut [&mut &[0]];
319- | ^^^^^^^^^^^^^^ the default binding mode is `ref mut`, introduced here
319+ | ^^^^^^^^^^^^^^ this matches on type `& mut _`
320320help: make the implied reference patterns explicit
321321 |
322322LL | let &mut [&mut &[ref a]] = &mut [&mut &[0]];
@@ -330,11 +330,11 @@ LL | let [&(_)] = &[&0];
330330 |
331331 = warning: this changes meaning in Rust 2024
332332 = 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
334334 --> $DIR/migration_lint.rs:150:9
335335 |
336336LL | let [&(_)] = &[&0];
337- | ^^^^^^ the default binding mode is `ref`, introduced here
337+ | ^^^^^^ this matches on type `&_`
338338help: make the implied reference pattern explicit
339339 |
340340LL | let &[&(_)] = &[&0];
0 commit comments