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