@@ -585,16 +585,34 @@ help: make the implied reference pattern explicit
585585LL | let &[migration_lint_macros::bind_ref!(a)] = &[0];
586586 | +
587587
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+
588606error: 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
590608 |
591609LL | let [&migration_lint_macros::bind_ref!(a)] = &[&0];
592610 | ^ reference pattern not allowed under `ref` default binding mode
593611 |
594612 = warning: this changes meaning in Rust 2024
595613 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
596614note: 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
598616 |
599617LL | let [&migration_lint_macros::bind_ref!(a)] = &[&0];
600618 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_`
@@ -603,5 +621,23 @@ help: make the implied reference pattern explicit
603621LL | let &[&migration_lint_macros::bind_ref!(a)] = &[&0];
604622 | +
605623
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
607643
0 commit comments