1 error[E0596]: cannot borrow immutable local variable `x` as mutable
2 --> $DIR/borrowck-access-permissions.rs:22:24
5 | - help: make this binding mutable: `mut x`
7 LL | let _y1 = &mut x; //[ast]~ ERROR [E0596]
8 | ^ cannot borrow mutably
10 error[E0596]: cannot borrow immutable static item as mutable
11 --> $DIR/borrowck-access-permissions.rs:28:24
13 LL | let _y1 = &mut static_x; //[ast]~ ERROR [E0596]
16 error[E0596]: cannot borrow immutable `Box` content `*box_x` as mutable
17 --> $DIR/borrowck-access-permissions.rs:37:24
19 LL | let box_x = Box::new(1);
20 | ----- help: make this binding mutable: `mut box_x`
22 LL | let _y1 = &mut *box_x; //[ast]~ ERROR [E0596]
23 | ^^^^^^ cannot borrow as mutable
25 error[E0596]: cannot borrow immutable borrowed content `*ref_x` as mutable
26 --> $DIR/borrowck-access-permissions.rs:46:24
28 LL | let _y1 = &mut *ref_x; //[ast]~ ERROR [E0596]
29 | ^^^^^^ cannot borrow as mutable
31 error[E0596]: cannot borrow immutable dereference of raw pointer `*ptr_x` as mutable
32 --> $DIR/borrowck-access-permissions.rs:56:28
34 LL | let _y1 = &mut *ptr_x; //[ast]~ ERROR [E0596]
35 | ^^^^^^ cannot borrow as mutable
37 error[E0389]: cannot borrow data mutably in a `&` reference
38 --> $DIR/borrowck-access-permissions.rs:66:23
40 LL | let _y = &mut *foo_ref.f; //[ast]~ ERROR [E0389]
41 | ^^^^^^^^^^ assignment into an immutable reference
43 error: aborting due to 6 previous errors
45 Some errors occurred: E0389, E0596.
46 For more information about an error, try `rustc --explain E0389`.