@@ -4,13 +4,13 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
4
4
LL | let x = 1;
5
5
| - help: consider changing this to be mutable: `mut x`
6
6
...
7
- LL | let _y1 = &mut x; //[ast]~ ERROR [E0596]
7
+ LL | let _y1 = &mut x;
8
8
| ^^^^^^ cannot borrow as mutable
9
9
10
10
error[E0596]: cannot borrow immutable static item `static_x` as mutable
11
11
--> $DIR/borrowck-access-permissions.rs:18:19
12
12
|
13
- LL | let _y1 = &mut static_x; //[ast]~ ERROR [E0596]
13
+ LL | let _y1 = &mut static_x;
14
14
| ^^^^^^^^^^^^^ cannot borrow as mutable
15
15
16
16
error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as mutable
@@ -19,7 +19,7 @@ error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as m
19
19
LL | let box_x = Box::new(1);
20
20
| ----- help: consider changing this to be mutable: `mut box_x`
21
21
...
22
- LL | let _y1 = &mut *box_x; //[ast]~ ERROR [E0596]
22
+ LL | let _y1 = &mut *box_x;
23
23
| ^^^^^^^^^^^ cannot borrow as mutable
24
24
25
25
error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference
@@ -28,7 +28,7 @@ error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference
28
28
LL | let ref_x = &x;
29
29
| -- help: consider changing this to be a mutable reference: `&mut x`
30
30
...
31
- LL | let _y1 = &mut *ref_x; //[ast]~ ERROR [E0596]
31
+ LL | let _y1 = &mut *ref_x;
32
32
| ^^^^^^^^^^^ `ref_x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
33
33
34
34
error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` pointer
@@ -37,15 +37,15 @@ error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` poin
37
37
LL | let ptr_x : *const _ = &x;
38
38
| -- help: consider changing this to be a mutable pointer: `&mut x`
39
39
...
40
- LL | let _y1 = &mut *ptr_x; //[ast]~ ERROR [E0596]
40
+ LL | let _y1 = &mut *ptr_x;
41
41
| ^^^^^^^^^^^ `ptr_x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable
42
42
43
43
error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` reference
44
44
--> $DIR/borrowck-access-permissions.rs:56:18
45
45
|
46
46
LL | let foo_ref = &foo;
47
47
| ---- help: consider changing this to be a mutable reference: `&mut foo`
48
- LL | let _y = &mut *foo_ref.f; //[ast]~ ERROR [E0389]
48
+ LL | let _y = &mut *foo_ref.f;
49
49
| ^^^^^^^^^^^^^^^ `foo_ref` is a `&` reference, so the data it refers to cannot be borrowed as mutable
50
50
51
51
error: aborting due to 6 previous errors
0 commit comments