
This aligns the main error message a bit more with the phrasing in the Edition Guide and provides a bit more information on the labels to (hopefully!) aid in understanding.
42 lines
1.3 KiB
Text
42 lines
1.3 KiB
Text
error[E0308]: mismatched types
|
|
--> $DIR/ref-binding-on-inh-ref-errors.rs:39: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:45: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[E0596]: cannot borrow data in a `&` reference as mutable
|
|
--> $DIR/ref-binding-on-inh-ref-errors.rs:67:10
|
|
|
|
|
LL | let [ref mut x] = &[0];
|
|
| ^^^^^^^^^ cannot borrow as mutable
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
Some errors have detailed explanations: E0308, E0596.
|
|
For more information about an error, try `rustc --explain E0308`.
|