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