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 | _____________-------_-
38 | | expects `Fn` instead of `FnMut`
39 LL | | let y = &raw mut x;
40 | | ^^^^^^^^^^ cannot borrow as mutable
42 | |_____- in this closure
44 error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
45 --> $DIR/borrow-raw-address-of-mutability.rs:37:17
47 LL | fn make_fn<F: Fn()>(f: F) -> F { f }
48 | - change this to accept `FnMut` instead of `Fn`
50 LL | let f = make_fn(move || {
51 | _____________-------_-
53 | | expects `Fn` instead of `FnMut`
54 LL | | let y = &raw mut x;
55 | | ^^^^^^^^^^ cannot borrow as mutable
57 | |_____- in this closure
59 error: aborting due to 5 previous errors
61 For more information about this error, try `rustc --explain E0596`.