Files
rust/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.structural2024.stderr
dianne e24833a4a8 add test revisions for old-edition behavior of feature gates
This also adds `#[cfg]` attributes to tests for bindings' types,
to make it visually clearer which revisions type successfully.
2025-02-18 17:44:28 -08:00

197 lines
8.2 KiB
Plaintext

error: binding modifiers may only be written when the default binding mode is `move`
--> $DIR/ref-binding-on-inh-ref-errors.rs:17: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:17: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:22: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:22: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:27: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:27: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:32: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:32: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:41: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:41: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:48: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:48: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:58: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:58: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:71: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:71: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:71: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:79: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:79: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:83: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:83: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:87: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:87: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`.