-
Notifications
You must be signed in to change notification settings - Fork 13.1k
/
Copy pathissue-39544.nll.stderr
102 lines (89 loc) · 4.94 KB
/
issue-39544.nll.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable
--> $DIR/issue-39544.rs:21:13
|
LL | let z = Z { x: X::Y };
| - help: consider changing this to be mutable: `mut z`
LL | let _ = &mut z.x; //~ ERROR cannot borrow
| ^^^^^^^^ cannot borrow as mutable
error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
--> $DIR/issue-39544.rs:26:17
|
LL | fn foo<'z>(&'z self) {
| -------- help: consider changing this to be a mutable reference: `&mut self`
LL | let _ = &mut self.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
--> $DIR/issue-39544.rs:30:17
|
LL | fn foo1(&self, other: &Z) {
| ----- help: consider changing this to be a mutable reference: `&mut self`
LL | let _ = &mut self.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
--> $DIR/issue-39544.rs:31:17
|
LL | fn foo1(&self, other: &Z) {
| -- help: consider changing this to be a mutable reference: `&mut Z`
LL | let _ = &mut self.x; //~ ERROR cannot borrow
LL | let _ = &mut other.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
--> $DIR/issue-39544.rs:35:17
|
LL | fn foo2<'a>(&'a self, other: &Z) {
| -------- help: consider changing this to be a mutable reference: `&mut self`
LL | let _ = &mut self.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
--> $DIR/issue-39544.rs:36:17
|
LL | fn foo2<'a>(&'a self, other: &Z) {
| -- help: consider changing this to be a mutable reference: `&mut Z`
LL | let _ = &mut self.x; //~ ERROR cannot borrow
LL | let _ = &mut other.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
--> $DIR/issue-39544.rs:40:17
|
LL | fn foo3<'a>(self: &'a Self, other: &Z) {
| -------- help: consider changing this to be a mutable reference: `&mut Z`
LL | let _ = &mut self.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
--> $DIR/issue-39544.rs:41:17
|
LL | fn foo3<'a>(self: &'a Self, other: &Z) {
| -- help: consider changing this to be a mutable reference: `&mut Z`
LL | let _ = &mut self.x; //~ ERROR cannot borrow
LL | let _ = &mut other.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
--> $DIR/issue-39544.rs:45:17
|
LL | fn foo4(other: &Z) {
| -- help: consider changing this to be a mutable reference: `&mut Z`
LL | let _ = &mut other.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable
--> $DIR/issue-39544.rs:51:13
|
LL | pub fn with_arg(z: Z, w: &Z) {
| - help: consider changing this to be mutable: `mut z`
LL | let _ = &mut z.x; //~ ERROR cannot borrow
| ^^^^^^^^ cannot borrow as mutable
error[E0596]: cannot borrow `w.x` as mutable, as it is behind a `&` reference
--> $DIR/issue-39544.rs:52:13
|
LL | pub fn with_arg(z: Z, w: &Z) {
| -- help: consider changing this to be a mutable reference: `&mut Z`
LL | let _ = &mut z.x; //~ ERROR cannot borrow
LL | let _ = &mut w.x; //~ ERROR cannot borrow
| ^^^^^^^^ `w` is a `&` reference, so the data it refers to cannot be borrowed as mutable
error[E0594]: cannot assign to `*x.0` which is behind a `&` reference
--> $DIR/issue-39544.rs:58:5
|
LL | *x.0 = 1;
| ^^^^^^^^ cannot assign
error: aborting due to 12 previous errors
Some errors occurred: E0594, E0596.
For more information about an error, try `rustc --explain E0594`.