-
Notifications
You must be signed in to change notification settings - Fork 12.2k
/
borrowck-access-permissions.ast.stderr
46 lines (39 loc) · 1.63 KB
/
borrowck-access-permissions.ast.stderr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
error[E0596]: cannot borrow immutable local variable `x` as mutable
--> $DIR/borrowck-access-permissions.rs:12:24
|
LL | let x = 1;
| - help: make this binding mutable: `mut x`
...
LL | let _y1 = &mut x;
| ^ cannot borrow mutably
error[E0596]: cannot borrow immutable static item as mutable
--> $DIR/borrowck-access-permissions.rs:18:24
|
LL | let _y1 = &mut static_x;
| ^^^^^^^^
error[E0596]: cannot borrow immutable `Box` content `*box_x` as mutable
--> $DIR/borrowck-access-permissions.rs:27:24
|
LL | let box_x = Box::new(1);
| ----- help: make this binding mutable: `mut box_x`
...
LL | let _y1 = &mut *box_x;
| ^^^^^^ cannot borrow as mutable
error[E0596]: cannot borrow immutable borrowed content `*ref_x` as mutable
--> $DIR/borrowck-access-permissions.rs:36:24
|
LL | let _y1 = &mut *ref_x;
| ^^^^^^ cannot borrow as mutable
error[E0596]: cannot borrow immutable dereference of raw pointer `*ptr_x` as mutable
--> $DIR/borrowck-access-permissions.rs:46:28
|
LL | let _y1 = &mut *ptr_x;
| ^^^^^^ cannot borrow as mutable
error[E0389]: cannot borrow data mutably in a `&` reference
--> $DIR/borrowck-access-permissions.rs:56:23
|
LL | let _y = &mut *foo_ref.f;
| ^^^^^^^^^^ assignment into an immutable reference
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0389, E0596.
For more information about an error, try `rustc --explain E0389`.