error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:19:11
   |
LL |     let [&ref x] = &[&0];
   |           ^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:19:9
   |
LL |     let [&ref x] = &[&0];
   |         ^^^^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
   |
LL |     let &[&ref x] = &[&0];
   |         +

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:24:11
   |
LL |     let [&ref x] = &mut [&0];
   |           ^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:24:9
   |
LL |     let [&ref x] = &mut [&0];
   |         ^^^^^^^^ this matches on type `&mut _`
help: make the implied reference pattern explicit
   |
LL |     let &mut [&ref x] = &mut [&0];
   |         ++++

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:29:15
   |
LL |     let [&mut ref x] = &mut [&mut 0];
   |               ^^^ binding modifier not allowed under `ref mut` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:29:9
   |
LL |     let [&mut ref x] = &mut [&mut 0];
   |         ^^^^^^^^^^^^ this matches on type `&mut _`
help: make the implied reference pattern explicit
   |
LL |     let &mut [&mut ref x] = &mut [&mut 0];
   |         ++++

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:34:15
   |
LL |     let [&mut ref mut x] = &mut [&mut 0];
   |               ^^^^^^^ binding modifier not allowed under `ref mut` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:34:9
   |
LL |     let [&mut ref mut x] = &mut [&mut 0];
   |         ^^^^^^^^^^^^^^^^ this matches on type `&mut _`
help: make the implied reference pattern explicit
   |
LL |     let &mut [&mut ref mut x] = &mut [&mut 0];
   |         ++++

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:43:11
   |
LL |     let [&ref x] = &[&mut 0];
   |           ^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:43:9
   |
LL |     let [&ref x] = &[&mut 0];
   |         ^^^^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
   |
LL |     let &[&ref x] = &[&mut 0];
   |         +

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:50:11
   |
LL |     let [&ref x] = &mut [&mut 0];
   |           ^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:50:9
   |
LL |     let [&ref x] = &mut [&mut 0];
   |         ^^^^^^^^ this matches on type `&mut _`
help: make the implied reference pattern explicit
   |
LL |     let &mut [&ref x] = &mut [&mut 0];
   |         ++++

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:60:15
   |
LL |     let [&mut ref x] = &[&mut 0];
   |               ^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:60:9
   |
LL |     let [&mut ref x] = &[&mut 0];
   |         ^^^^^^^^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
   |
LL |     let &[&mut ref x] = &[&mut 0];
   |         +

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:10
   |
LL |     let [ref mut x] = &[0];
   |          ^^^^^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:9
   |
LL |     let [ref mut x] = &[0];
   |         ^^^^^^^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
   |
LL |     let &[ref mut x] = &[0];
   |         +

error[E0596]: cannot borrow data in a `&` reference as mutable
  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:10
   |
LL |     let [ref mut x] = &[0];
   |          ^^^^^^^^^ cannot borrow as mutable

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:81:10
   |
LL |     let [ref x] = &[0];
   |          ^^^ binding modifier not allowed under `ref` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:81:9
   |
LL |     let [ref x] = &[0];
   |         ^^^^^^^ this matches on type `&_`
help: make the implied reference pattern explicit
   |
LL |     let &[ref x] = &[0];
   |         +

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:85:10
   |
LL |     let [ref x] = &mut [0];
   |          ^^^ binding modifier not allowed under `ref mut` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:85:9
   |
LL |     let [ref x] = &mut [0];
   |         ^^^^^^^ this matches on type `&mut _`
help: make the implied reference pattern explicit
   |
LL |     let &mut [ref x] = &mut [0];
   |         ++++

error: binding modifiers may only be written when the default binding mode is `move`
  --> $DIR/ref-binding-on-inh-ref-errors.rs:89:10
   |
LL |     let [ref mut x] = &mut [0];
   |          ^^^^^^^ binding modifier not allowed under `ref mut` default binding mode
   |
   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
note: matching on a reference type with a non-reference pattern changes the default binding mode
  --> $DIR/ref-binding-on-inh-ref-errors.rs:89:9
   |
LL |     let [ref mut x] = &mut [0];
   |         ^^^^^^^^^^^ this matches on type `&mut _`
help: make the implied reference pattern explicit
   |
LL |     let &mut [ref mut x] = &mut [0];
   |         ++++

error: aborting due to 12 previous errors

For more information about this error, try `rustc --explain E0596`.
