/
issue-39544.stderr
100 lines (87 loc) · 3.65 KB
/
issue-39544.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
error[E0596]: cannot borrow immutable field `z.x` as mutable
--> $DIR/issue-39544.rs:21:18
|
20 | let z = Z { x: X::Y };
| - consider changing this to `mut z`
21 | let _ = &mut z.x;
| ^^^ cannot mutably borrow immutable field
error[E0596]: cannot borrow immutable field `self.x` as mutable
--> $DIR/issue-39544.rs:26:22
|
25 | fn foo<'z>(&'z self) {
| -------- use `&'z mut self` here to make mutable
26 | let _ = &mut self.x;
| ^^^^^^ cannot mutably borrow immutable field
error[E0596]: cannot borrow immutable field `self.x` as mutable
--> $DIR/issue-39544.rs:30:22
|
29 | fn foo1(&self, other: &Z) {
| ----- use `&mut self` here to make mutable
30 | let _ = &mut self.x;
| ^^^^^^ cannot mutably borrow immutable field
error[E0596]: cannot borrow immutable field `other.x` as mutable
--> $DIR/issue-39544.rs:31:22
|
29 | fn foo1(&self, other: &Z) {
| -- use `&mut Z` here to make mutable
30 | let _ = &mut self.x;
31 | let _ = &mut other.x;
| ^^^^^^^ cannot mutably borrow immutable field
error[E0596]: cannot borrow immutable field `self.x` as mutable
--> $DIR/issue-39544.rs:35:22
|
34 | fn foo2<'a>(&'a self, other: &Z) {
| -------- use `&'a mut self` here to make mutable
35 | let _ = &mut self.x;
| ^^^^^^ cannot mutably borrow immutable field
error[E0596]: cannot borrow immutable field `other.x` as mutable
--> $DIR/issue-39544.rs:36:22
|
34 | fn foo2<'a>(&'a self, other: &Z) {
| -- use `&mut Z` here to make mutable
35 | let _ = &mut self.x;
36 | let _ = &mut other.x;
| ^^^^^^^ cannot mutably borrow immutable field
error[E0596]: cannot borrow immutable field `self.x` as mutable
--> $DIR/issue-39544.rs:40:22
|
39 | fn foo3<'a>(self: &'a Self, other: &Z) {
| -------- use `&'a mut Self` here to make mutable
40 | let _ = &mut self.x;
| ^^^^^^ cannot mutably borrow immutable field
error[E0596]: cannot borrow immutable field `other.x` as mutable
--> $DIR/issue-39544.rs:41:22
|
39 | fn foo3<'a>(self: &'a Self, other: &Z) {
| -- use `&mut Z` here to make mutable
40 | let _ = &mut self.x;
41 | let _ = &mut other.x;
| ^^^^^^^ cannot mutably borrow immutable field
error[E0596]: cannot borrow immutable field `other.x` as mutable
--> $DIR/issue-39544.rs:45:22
|
44 | fn foo4(other: &Z) {
| -- use `&mut Z` here to make mutable
45 | let _ = &mut other.x;
| ^^^^^^^ cannot mutably borrow immutable field
error[E0596]: cannot borrow immutable field `z.x` as mutable
--> $DIR/issue-39544.rs:51:18
|
50 | pub fn with_arg(z: Z, w: &Z) {
| - consider changing this to `mut z`
51 | let _ = &mut z.x;
| ^^^ cannot mutably borrow immutable field
error[E0596]: cannot borrow immutable field `w.x` as mutable
--> $DIR/issue-39544.rs:52:18
|
50 | pub fn with_arg(z: Z, w: &Z) {
| -- use `&mut Z` here to make mutable
51 | let _ = &mut z.x;
52 | let _ = &mut w.x;
| ^^^ cannot mutably borrow immutable field
error[E0594]: cannot assign to immutable borrowed content `*x.0`
--> $DIR/issue-39544.rs:58:5
|
58 | *x.0 = 1;
| ^^^^^^^^ cannot borrow as mutable
error: aborting due to previous error(s)