| error[E0308]: mismatched types |
| --> $DIR/ref-binding-on-inh-ref-errors.rs:43: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:50: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:73: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`. |