Files
rust/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.stable2021.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
1.1 KiB
Plaintext
Raw Normal View History

error[E0308]: mismatched types
--> $DIR/ref-binding-on-inh-ref-errors.rs:46:10
|
LL | let [&ref x] = &[&mut 0];
| ^^^^^^ --------- this expression has type `&[&mut {integer}; 1]`
| |
| types differ in mutability
|
= note: expected mutable reference `&mut {integer}`
found reference `&_`
help: consider removing `&` from the pattern
|
LL - let [&ref x] = &[&mut 0];
LL + let [ref x] = &[&mut 0];
|
error[E0308]: mismatched types
--> $DIR/ref-binding-on-inh-ref-errors.rs:53:10
|
LL | let [&ref x] = &mut [&mut 0];
| ^^^^^^ ------------- this expression has type `&mut [&mut {integer}; 1]`
| |
| types differ in mutability
|
= note: expected mutable reference `&mut {integer}`
found reference `&_`
help: consider removing `&` from the pattern
|
LL - let [&ref x] = &mut [&mut 0];
LL + let [ref x] = &mut [&mut 0];
|
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.