]> git.proxmox.com Git - rustc.git/blob - tests/ui/did_you_mean/issue-39544.stderr
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / did_you_mean / issue-39544.stderr
1 error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable
2 --> $DIR/issue-39544.rs:11:13
3 |
4 LL | let _ = &mut z.x;
5 | ^^^^^^^^ cannot borrow as mutable
6 |
7 help: consider changing this to be mutable
8 |
9 LL | let mut z = Z { x: X::Y };
10 | +++
11
12 error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
13 --> $DIR/issue-39544.rs:16:17
14 |
15 LL | let _ = &mut self.x;
16 | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
17 |
18 help: consider changing this to be a mutable reference
19 |
20 LL | fn foo<'z>(&'z mut self) {
21 | ~~~~~~~~~~~~
22
23 error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
24 --> $DIR/issue-39544.rs:20:17
25 |
26 LL | let _ = &mut self.x;
27 | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
28 |
29 help: consider changing this to be a mutable reference
30 |
31 LL | fn foo1(&mut self, other: &Z) {
32 | ~~~~~~~~~
33
34 error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
35 --> $DIR/issue-39544.rs:21:17
36 |
37 LL | let _ = &mut other.x;
38 | ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
39 |
40 help: consider changing this to be a mutable reference
41 |
42 LL | fn foo1(&self, other: &mut Z) {
43 | ~~~~~~
44
45 error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
46 --> $DIR/issue-39544.rs:25:17
47 |
48 LL | let _ = &mut self.x;
49 | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
50 |
51 help: consider changing this to be a mutable reference
52 |
53 LL | fn foo2<'a>(&'a mut self, other: &Z) {
54 | ~~~~~~~~~~~~
55
56 error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
57 --> $DIR/issue-39544.rs:26:17
58 |
59 LL | let _ = &mut other.x;
60 | ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
61 |
62 help: consider changing this to be a mutable reference
63 |
64 LL | fn foo2<'a>(&'a self, other: &mut Z) {
65 | ~~~~~~
66
67 error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
68 --> $DIR/issue-39544.rs:30:17
69 |
70 LL | let _ = &mut self.x;
71 | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
72 |
73 help: consider changing this to be a mutable reference
74 |
75 LL | fn foo3<'a>(self: &'a mut Self, other: &Z) {
76 | ~~~~~~~~~~~~
77
78 error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
79 --> $DIR/issue-39544.rs:31:17
80 |
81 LL | let _ = &mut other.x;
82 | ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
83 |
84 help: consider changing this to be a mutable reference
85 |
86 LL | fn foo3<'a>(self: &'a Self, other: &mut Z) {
87 | ~~~~~~
88
89 error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
90 --> $DIR/issue-39544.rs:35:17
91 |
92 LL | let _ = &mut other.x;
93 | ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
94 |
95 help: consider changing this to be a mutable reference
96 |
97 LL | fn foo4(other: &mut Z) {
98 | ~~~~~~
99
100 error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable
101 --> $DIR/issue-39544.rs:41:13
102 |
103 LL | let _ = &mut z.x;
104 | ^^^^^^^^ cannot borrow as mutable
105 |
106 help: consider changing this to be mutable
107 |
108 LL | pub fn with_arg(mut z: Z, w: &Z) {
109 | +++
110
111 error[E0596]: cannot borrow `w.x` as mutable, as it is behind a `&` reference
112 --> $DIR/issue-39544.rs:42:13
113 |
114 LL | let _ = &mut w.x;
115 | ^^^^^^^^ `w` is a `&` reference, so the data it refers to cannot be borrowed as mutable
116 |
117 help: consider changing this to be a mutable reference
118 |
119 LL | pub fn with_arg(z: Z, w: &mut Z) {
120 | ~~~~~~
121
122 error[E0594]: cannot assign to `*x.0`, which is behind a `&` reference
123 --> $DIR/issue-39544.rs:48:5
124 |
125 LL | *x.0 = 1;
126 | ^^^^^^^^ cannot assign
127
128 error: aborting due to 12 previous errors
129
130 Some errors have detailed explanations: E0594, E0596.
131 For more information about an error, try `rustc --explain E0594`.