1 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
2 --> $DIR/borrowck-access-permissions.rs:9:19
5 | ^^^^^^ cannot borrow as mutable
7 help: consider changing this to be mutable
12 error[E0596]: cannot borrow immutable static item `static_x` as mutable
13 --> $DIR/borrowck-access-permissions.rs:14:19
15 LL | let _y1 = &mut static_x;
16 | ^^^^^^^^^^^^^ cannot borrow as mutable
18 error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as mutable
19 --> $DIR/borrowck-access-permissions.rs:22:19
21 LL | let _y1 = &mut *box_x;
22 | ^^^^^^^^^^^ cannot borrow as mutable
24 help: consider changing this to be mutable
26 LL | let mut box_x = Box::new(1);
29 error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference
30 --> $DIR/borrowck-access-permissions.rs:30:19
32 LL | let _y1 = &mut *ref_x;
33 | ^^^^^^^^^^^ `ref_x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
35 help: consider changing this to be a mutable reference
37 LL | let ref_x = &mut x;
40 error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` pointer
41 --> $DIR/borrowck-access-permissions.rs:39:23
43 LL | let _y1 = &mut *ptr_x;
44 | ^^^^^^^^^^^ `ptr_x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable
46 help: consider changing this to be a mutable pointer
48 LL | let ptr_x : *const _ = &mut x;
51 error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` reference
52 --> $DIR/borrowck-access-permissions.rs:48:18
54 LL | let _y = &mut *foo_ref.f;
55 | ^^^^^^^^^^^^^^^ `foo_ref` is a `&` reference, so the data it refers to cannot be borrowed as mutable
57 help: consider changing this to be a mutable reference
59 LL | let foo_ref = &mut foo;
62 error: aborting due to 6 previous errors
64 For more information about this error, try `rustc --explain E0596`.