1 error: cannot borrow immutable field `z.x` as mutable
2 --> $DIR/issue-39544.rs:21:18
4 20 | let z = Z { x: X::Y };
5 | - consider changing this to `mut z`
7 | ^^^ cannot mutably borrow immutable field
9 error: cannot borrow immutable field `self.x` as mutable
10 --> $DIR/issue-39544.rs:26:22
12 25 | fn foo<'z>(&'z self) {
13 | -------- use `&'z mut self` here to make mutable
14 26 | let _ = &mut self.x;
15 | ^^^^^^ cannot mutably borrow immutable field
17 error: cannot borrow immutable field `self.x` as mutable
18 --> $DIR/issue-39544.rs:30:22
20 29 | fn foo1(&self, other: &Z) {
21 | ----- use `&mut self` here to make mutable
22 30 | let _ = &mut self.x;
23 | ^^^^^^ cannot mutably borrow immutable field
25 error: cannot borrow immutable field `other.x` as mutable
26 --> $DIR/issue-39544.rs:31:22
28 29 | fn foo1(&self, other: &Z) {
29 | -- use `&mut Z` here to make mutable
30 30 | let _ = &mut self.x;
31 31 | let _ = &mut other.x;
32 | ^^^^^^^ cannot mutably borrow immutable field
34 error: cannot borrow immutable field `self.x` as mutable
35 --> $DIR/issue-39544.rs:35:22
37 34 | fn foo2<'a>(&'a self, other: &Z) {
38 | -------- use `&'a mut self` here to make mutable
39 35 | let _ = &mut self.x;
40 | ^^^^^^ cannot mutably borrow immutable field
42 error: cannot borrow immutable field `other.x` as mutable
43 --> $DIR/issue-39544.rs:36:22
45 34 | fn foo2<'a>(&'a self, other: &Z) {
46 | -- use `&mut Z` here to make mutable
47 35 | let _ = &mut self.x;
48 36 | let _ = &mut other.x;
49 | ^^^^^^^ cannot mutably borrow immutable field
51 error: cannot borrow immutable field `self.x` as mutable
52 --> $DIR/issue-39544.rs:40:22
54 39 | fn foo3<'a>(self: &'a Self, other: &Z) {
55 | -------- use `&'a mut Self` here to make mutable
56 40 | let _ = &mut self.x;
57 | ^^^^^^ cannot mutably borrow immutable field
59 error: cannot borrow immutable field `other.x` as mutable
60 --> $DIR/issue-39544.rs:41:22
62 39 | fn foo3<'a>(self: &'a Self, other: &Z) {
63 | -- use `&mut Z` here to make mutable
64 40 | let _ = &mut self.x;
65 41 | let _ = &mut other.x;
66 | ^^^^^^^ cannot mutably borrow immutable field
68 error: cannot borrow immutable field `other.x` as mutable
69 --> $DIR/issue-39544.rs:45:22
71 44 | fn foo4(other: &Z) {
72 | -- use `&mut Z` here to make mutable
73 45 | let _ = &mut other.x;
74 | ^^^^^^^ cannot mutably borrow immutable field
76 error: cannot borrow immutable field `z.x` as mutable
77 --> $DIR/issue-39544.rs:51:18
79 50 | pub fn with_arg(z: Z, w: &Z) {
80 | - consider changing this to `mut z`
81 51 | let _ = &mut z.x;
82 | ^^^ cannot mutably borrow immutable field
84 error: cannot borrow immutable field `w.x` as mutable
85 --> $DIR/issue-39544.rs:52:18
87 50 | pub fn with_arg(z: Z, w: &Z) {
88 | -- use `&mut Z` here to make mutable
89 51 | let _ = &mut z.x;
90 52 | let _ = &mut w.x;
91 | ^^^ cannot mutably borrow immutable field
93 error: cannot assign to immutable borrowed content `*x.0`
94 --> $DIR/issue-39544.rs:58:5
97 | ^^^^^^^^ cannot borrow as mutable
99 error: aborting due to 12 previous errors