1 error[E0070]: invalid left-hand side of assignment
2 --> $DIR/assign-non-lval-mut-ref.rs:5:27
4 LL | x.last_mut().unwrap() = 2;
5 | --------------------- ^
7 | cannot assign to this expression
9 help: consider dereferencing here to assign to the mutably borrowed value
11 LL | *x.last_mut().unwrap() = 2;
14 error[E0368]: binary assignment operation `+=` cannot be applied to type `&mut usize`
15 --> $DIR/assign-non-lval-mut-ref.rs:7:5
17 LL | x.last_mut().unwrap() += 1;
18 | ---------------------^^^^^
20 | cannot use `+=` on type `&mut usize`
22 help: `+=` can be used on `usize` if you dereference the left-hand side
24 LL | *x.last_mut().unwrap() += 1;
27 error[E0308]: mismatched types
28 --> $DIR/assign-non-lval-mut-ref.rs:11:9
30 LL | let y = x.last_mut().unwrap();
31 | --------------------- expected due to this value
33 | ^ expected `&mut usize`, found integer
35 help: consider dereferencing here to assign to the mutably borrowed value
40 error[E0368]: binary assignment operation `+=` cannot be applied to type `&mut usize`
41 --> $DIR/assign-non-lval-mut-ref.rs:13:5
46 | cannot use `+=` on type `&mut usize`
48 help: `+=` can be used on `usize` if you dereference the left-hand side
53 error: aborting due to 4 previous errors
55 Some errors have detailed explanations: E0070, E0308, E0368.
56 For more information about an error, try `rustc --explain E0070`.