1 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
2 --> $DIR/borrow-raw-address-of-mutability.rs:5:13
5 | - help: consider changing this to be mutable: `mut x`
6 LL | let y = &raw mut x;
7 | ^^^^^^^^^^ cannot borrow as mutable
9 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
10 --> $DIR/borrow-raw-address-of-mutability.rs:11:17
13 | - help: consider changing this to be mutable: `mut x`
15 LL | let y = &raw mut x;
16 | ^^^^^^^^^^ cannot borrow as mutable
18 error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
19 --> $DIR/borrow-raw-address-of-mutability.rs:21:5
22 | - help: consider changing this to be mutable: `mut f`
23 LL | let y = &raw mut x;
24 | - calling `f` requires mutable binding due to mutable borrow of `x`
27 | ^ cannot borrow as mutable
29 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
30 --> $DIR/borrow-raw-address-of-mutability.rs:29:17
32 LL | fn make_fn<F: Fn()>(f: F) -> F { f }
33 | - change this to accept `FnMut` instead of `Fn`
35 LL | let f = make_fn(|| {
36 | ------- -- in this closure
38 | expects `Fn` instead of `FnMut`
39 LL | let y = &raw mut x;
40 | ^^^^^^^^^^ cannot borrow as mutable
42 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
43 --> $DIR/borrow-raw-address-of-mutability.rs:37:17
45 LL | fn make_fn<F: Fn()>(f: F) -> F { f }
46 | - change this to accept `FnMut` instead of `Fn`
48 LL | let f = make_fn(move || {
49 | ------- ------- in this closure
51 | expects `Fn` instead of `FnMut`
52 LL | let y = &raw mut x;
53 | ^^^^^^^^^^ cannot borrow as mutable
55 error: aborting due to 5 previous errors
57 For more information about this error, try `rustc --explain E0596`.