Skip to content

Commit 9964b95

Browse files
committed
remove comment on pattern migration tests about possible future improvements
The following commits are the possible future improvements.
1 parent 51a2ee3 commit 9964b95

File tree

3 files changed

+24
-28
lines changed

3 files changed

+24
-28
lines changed

tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.fixed

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ fn main() {
151151
//~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024
152152
//~| WARN: this changes meaning in Rust 2024
153153

154-
// NB: Most of the following tests are for possible future improvements to migration suggestions
155-
156154
// Test removing multiple binding modifiers.
157155
let Struct { a, b, c } = &Struct { a: 0, b: 0, c: 0 };
158156
//~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024

tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ fn main() {
151151
//~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024
152152
//~| WARN: this changes meaning in Rust 2024
153153

154-
// NB: Most of the following tests are for possible future improvements to migration suggestions
155-
156154
// Test removing multiple binding modifiers.
157155
let Struct { ref a, ref b, c } = &Struct { a: 0, b: 0, c: 0 };
158156
//~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024

tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.stderr

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ LL | let &[&(_)] = &[&0];
342342
| +
343343

344344
error: binding modifiers may only be written when the default binding mode is `move` in Rust 2024
345-
--> $DIR/migration_lint.rs:157:18
345+
--> $DIR/migration_lint.rs:155:18
346346
|
347347
LL | let Struct { ref a, ref b, c } = &Struct { a: 0, b: 0, c: 0 };
348348
| ^^^ ^^^ binding modifier not allowed under `ref` default binding mode
@@ -352,7 +352,7 @@ LL | let Struct { ref a, ref b, c } = &Struct { a: 0, b: 0, c: 0 };
352352
= warning: this changes meaning in Rust 2024
353353
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
354354
note: matching on a reference type with a non-reference pattern changes the default binding mode
355-
--> $DIR/migration_lint.rs:157:9
355+
--> $DIR/migration_lint.rs:155:9
356356
|
357357
LL | let Struct { ref a, ref b, c } = &Struct { a: 0, b: 0, c: 0 };
358358
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
@@ -363,7 +363,7 @@ LL + let Struct { a, b, c } = &Struct { a: 0, b: 0, c: 0 };
363363
|
364364

365365
error: binding modifiers may only be written when the default binding mode is `move` in Rust 2024
366-
--> $DIR/migration_lint.rs:164:18
366+
--> $DIR/migration_lint.rs:162:18
367367
|
368368
LL | let Struct { ref a, ref mut b, c } = &mut Struct { a: 0, b: 0, c: 0 };
369369
| ^^^ ^^^^^^^ binding modifier not allowed under `ref mut` default binding mode
@@ -373,7 +373,7 @@ LL | let Struct { ref a, ref mut b, c } = &mut Struct { a: 0, b: 0, c: 0 };
373373
= warning: this changes meaning in Rust 2024
374374
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
375375
note: matching on a reference type with a non-reference pattern changes the default binding mode
376-
--> $DIR/migration_lint.rs:164:9
376+
--> $DIR/migration_lint.rs:162:9
377377
|
378378
LL | let Struct { ref a, ref mut b, c } = &mut Struct { a: 0, b: 0, c: 0 };
379379
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&mut _`
@@ -383,7 +383,7 @@ LL | let &mut Struct { ref a, ref mut b, ref mut c } = &mut Struct { a: 0, b
383383
| ++++ +++++++
384384

385385
error: reference patterns may only be written when the default binding mode is `move` in Rust 2024
386-
--> $DIR/migration_lint.rs:172:21
386+
--> $DIR/migration_lint.rs:170:21
387387
|
388388
LL | let Struct { a: &[ref a], b: &mut [[b]], c } = &mut &Struct { a: &[0], b: &mut [&[0]], c: 0 };
389389
| ^ ^^^^ reference pattern not allowed under `ref` default binding mode
@@ -393,7 +393,7 @@ LL | let Struct { a: &[ref a], b: &mut [[b]], c } = &mut &Struct { a: &[0],
393393
= warning: this changes meaning in Rust 2024
394394
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
395395
note: matching on a reference type with a non-reference pattern changes the default binding mode
396-
--> $DIR/migration_lint.rs:172:9
396+
--> $DIR/migration_lint.rs:170:9
397397
|
398398
LL | let Struct { a: &[ref a], b: &mut [[b]], c } = &mut &Struct { a: &[0], b: &mut [&[0]], c: 0 };
399399
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
@@ -403,15 +403,15 @@ LL | let &mut &Struct { a: &[ref a], b: &mut [&[ref b]], ref c } = &mut &Str
403403
| ++++++ + +++ +++
404404

405405
error: reference patterns may only be written when the default binding mode is `move` in Rust 2024
406-
--> $DIR/migration_lint.rs:180:13
406+
--> $DIR/migration_lint.rs:178:13
407407
|
408408
LL | let Foo(&ref a) = &Foo(&0);
409409
| ^ reference pattern not allowed under `ref` default binding mode
410410
|
411411
= warning: this changes meaning in Rust 2024
412412
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
413413
note: matching on a reference type with a non-reference pattern changes the default binding mode
414-
--> $DIR/migration_lint.rs:180:9
414+
--> $DIR/migration_lint.rs:178:9
415415
|
416416
LL | let Foo(&ref a) = &Foo(&0);
417417
| ^^^^^^^^^^^ this matches on type `&_`
@@ -421,15 +421,15 @@ LL | let &Foo(&ref a) = &Foo(&0);
421421
| +
422422

423423
error: reference patterns may only be written when the default binding mode is `move` in Rust 2024
424-
--> $DIR/migration_lint.rs:186:10
424+
--> $DIR/migration_lint.rs:184:10
425425
|
426426
LL | let (&a, b, [c], [(d, [e])]) = &(&0, 0, &[0], &mut [&mut (0, &[0])]);
427427
| ^ reference pattern not allowed under `ref` default binding mode
428428
|
429429
= warning: this changes meaning in Rust 2024
430430
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
431431
note: matching on a reference type with a non-reference pattern changes the default binding mode
432-
--> $DIR/migration_lint.rs:186:9
432+
--> $DIR/migration_lint.rs:184:9
433433
|
434434
LL | let (&a, b, [c], [(d, [e])]) = &(&0, 0, &[0], &mut [&mut (0, &[0])]);
435435
| ^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
@@ -439,15 +439,15 @@ LL | let &(&a, ref b, &[ref c], &mut [&mut (ref d, &[ref e])]) = &(&0, 0, &[
439439
| + +++ + +++ ++++ ++++ +++ + +++
440440

441441
error: binding modifiers may only be written when the default binding mode is `move` in Rust 2024
442-
--> $DIR/migration_lint.rs:196:19
442+
--> $DIR/migration_lint.rs:194:19
443443
|
444444
LL | let (a, [b], [mut c]) = &(0, &mut [0], &[0]);
445445
| ^^^ binding modifier not allowed under `ref` default binding mode
446446
|
447447
= warning: this changes meaning in Rust 2024
448448
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
449449
note: matching on a reference type with a non-reference pattern changes the default binding mode
450-
--> $DIR/migration_lint.rs:196:9
450+
--> $DIR/migration_lint.rs:194:9
451451
|
452452
LL | let (a, [b], [mut c]) = &(0, &mut [0], &[0]);
453453
| ^^^^^^^^^^^^^^^^^ this matches on type `&_`
@@ -457,7 +457,7 @@ LL | let &(ref a, &mut [ref b], &[mut c]) = &(0, &mut [0], &[0]);
457457
| + +++ ++++ +++ +
458458

459459
error: reference patterns may only be written when the default binding mode is `move` in Rust 2024
460-
--> $DIR/migration_lint.rs:204:10
460+
--> $DIR/migration_lint.rs:202:10
461461
|
462462
LL | let (&a, (b, &[ref c])) = &(&0, &mut (0, &[0]));
463463
| ^ ^ reference pattern not allowed under `ref` default binding mode
@@ -467,7 +467,7 @@ LL | let (&a, (b, &[ref c])) = &(&0, &mut (0, &[0]));
467467
= warning: this changes meaning in Rust 2024
468468
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
469469
note: matching on a reference type with a non-reference pattern changes the default binding mode
470-
--> $DIR/migration_lint.rs:204:9
470+
--> $DIR/migration_lint.rs:202:9
471471
|
472472
LL | let (&a, (b, &[ref c])) = &(&0, &mut (0, &[0]));
473473
| ^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
@@ -477,15 +477,15 @@ LL | let &(&a, &mut (ref b, &[ref c])) = &(&0, &mut (0, &[0]));
477477
| + ++++ +++
478478

479479
error: binding modifiers may only be written when the default binding mode is `move` in Rust 2024
480-
--> $DIR/migration_lint.rs:212:10
480+
--> $DIR/migration_lint.rs:210:10
481481
|
482482
LL | let [mut a @ b] = &[0];
483483
| ^^^ binding modifier not allowed under `ref` default binding mode
484484
|
485485
= warning: this changes meaning in Rust 2024
486486
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
487487
note: matching on a reference type with a non-reference pattern changes the default binding mode
488-
--> $DIR/migration_lint.rs:212:9
488+
--> $DIR/migration_lint.rs:210:9
489489
|
490490
LL | let [mut a @ b] = &[0];
491491
| ^^^^^^^^^^^ this matches on type `&_`
@@ -495,15 +495,15 @@ LL | let &[mut a @ ref b] = &[0];
495495
| + +++
496496

497497
error: binding modifiers may only be written when the default binding mode is `move` in Rust 2024
498-
--> $DIR/migration_lint.rs:219:14
498+
--> $DIR/migration_lint.rs:217:14
499499
|
500500
LL | let [a @ mut b] = &[0];
501501
| ^^^ binding modifier not allowed under `ref` default binding mode
502502
|
503503
= warning: this changes meaning in Rust 2024
504504
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
505505
note: matching on a reference type with a non-reference pattern changes the default binding mode
506-
--> $DIR/migration_lint.rs:219:9
506+
--> $DIR/migration_lint.rs:217:9
507507
|
508508
LL | let [a @ mut b] = &[0];
509509
| ^^^^^^^^^^^ this matches on type `&_`
@@ -513,7 +513,7 @@ LL | let &[ref a @ mut b] = &[0];
513513
| + +++
514514

515515
error: reference patterns may only be written when the default binding mode is `move` in Rust 2024
516-
--> $DIR/migration_lint.rs:226:14
516+
--> $DIR/migration_lint.rs:224:14
517517
|
518518
LL | let [Foo(&ref a @ ref b), Foo(&ref c @ d)] = [&Foo(&0); 2];
519519
| ^ ^ reference pattern not allowed under `ref` default binding mode
@@ -523,12 +523,12 @@ LL | let [Foo(&ref a @ ref b), Foo(&ref c @ d)] = [&Foo(&0); 2];
523523
= warning: this changes meaning in Rust 2024
524524
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
525525
note: matching on a reference type with a non-reference pattern changes the default binding mode
526-
--> $DIR/migration_lint.rs:226:31
526+
--> $DIR/migration_lint.rs:224:31
527527
|
528528
LL | let [Foo(&ref a @ ref b), Foo(&ref c @ d)] = [&Foo(&0); 2];
529529
| ^^^^^^^^^^^^^^^ this matches on type `&_`
530530
note: matching on a reference type with a non-reference pattern changes the default binding mode
531-
--> $DIR/migration_lint.rs:226:10
531+
--> $DIR/migration_lint.rs:224:10
532532
|
533533
LL | let [Foo(&ref a @ ref b), Foo(&ref c @ d)] = [&Foo(&0); 2];
534534
| ^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
@@ -538,7 +538,7 @@ LL | let [&Foo(&ref a @ ref b), &Foo(&ref c @ d)] = [&Foo(&0); 2];
538538
| + +
539539

540540
error: reference patterns may only be written when the default binding mode is `move` in Rust 2024
541-
--> $DIR/migration_lint.rs:235:14
541+
--> $DIR/migration_lint.rs:233:14
542542
|
543543
LL | let [Foo(&ref a @ [ref b]), Foo(&ref c @ [d])] = [&Foo(&[0]); 2];
544544
| ^ ^ reference pattern not allowed under `ref` default binding mode
@@ -548,12 +548,12 @@ LL | let [Foo(&ref a @ [ref b]), Foo(&ref c @ [d])] = [&Foo(&[0]); 2];
548548
= warning: this changes meaning in Rust 2024
549549
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
550550
note: matching on a reference type with a non-reference pattern changes the default binding mode
551-
--> $DIR/migration_lint.rs:235:33
551+
--> $DIR/migration_lint.rs:233:33
552552
|
553553
LL | let [Foo(&ref a @ [ref b]), Foo(&ref c @ [d])] = [&Foo(&[0]); 2];
554554
| ^^^^^^^^^^^^^^^^^ this matches on type `&_`
555555
note: matching on a reference type with a non-reference pattern changes the default binding mode
556-
--> $DIR/migration_lint.rs:235:10
556+
--> $DIR/migration_lint.rs:233:10
557557
|
558558
LL | let [Foo(&ref a @ [ref b]), Foo(&ref c @ [d])] = [&Foo(&[0]); 2];
559559
| ^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`

0 commit comments

Comments
 (0)