@@ -585,16 +585,34 @@ help: make the implied reference pattern explicit
585
585
LL | let &[migration_lint_macros::bind_ref!(a)] = &[0];
586
586
| +
587
587
588
+ error: reference patterns may only be written when the default binding mode is `move`
589
+ --> $DIR/migration_lint.rs:246:10
590
+ |
591
+ LL | let [migration_lint_macros::match_ref!(a)] = &[&0];
592
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ occurs within macro expansion
593
+ |
594
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
595
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
596
+ --> $DIR/migration_lint.rs:246:9
597
+ |
598
+ LL | let [migration_lint_macros::match_ref!(a)] = &[&0];
599
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
600
+ = note: this error originates in the macro `migration_lint_macros::match_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
601
+ help: make the implied reference pattern explicit
602
+ |
603
+ LL | let &[migration_lint_macros::match_ref!(a)] = &[&0];
604
+ | +
605
+
588
606
error: reference patterns may only be written when the default binding mode is `move` in Rust 2024
589
- --> $DIR/migration_lint.rs:249 :10
607
+ --> $DIR/migration_lint.rs:252 :10
590
608
|
591
609
LL | let [&migration_lint_macros::bind_ref!(a)] = &[&0];
592
610
| ^ reference pattern not allowed under `ref` default binding mode
593
611
|
594
612
= warning: this changes meaning in Rust 2024
595
613
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
596
614
note: matching on a reference type with a non-reference pattern changes the default binding mode
597
- --> $DIR/migration_lint.rs:249 :9
615
+ --> $DIR/migration_lint.rs:252 :9
598
616
|
599
617
LL | let [&migration_lint_macros::bind_ref!(a)] = &[&0];
600
618
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
@@ -603,5 +621,23 @@ help: make the implied reference pattern explicit
603
621
LL | let &[&migration_lint_macros::bind_ref!(a)] = &[&0];
604
622
| +
605
623
606
- error: aborting due to 31 previous errors
624
+ error: reference patterns may only be written when the default binding mode is `move`
625
+ --> $DIR/migration_lint.rs:258:10
626
+ |
627
+ LL | let [migration_lint_macros::match_ref!(ref a)] = &[&0];
628
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ occurs within macro expansion
629
+ |
630
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
631
+ note: matching on a reference type with a non-reference pattern changes the default binding mode
632
+ --> $DIR/migration_lint.rs:258:9
633
+ |
634
+ LL | let [migration_lint_macros::match_ref!(ref a)] = &[&0];
635
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
636
+ = note: this error originates in the macro `migration_lint_macros::match_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
637
+ help: make the implied reference pattern explicit
638
+ |
639
+ LL | let &[migration_lint_macros::match_ref!(ref a)] = &[&0];
640
+ | +
641
+
642
+ error: aborting due to 33 previous errors
607
643
0 commit comments