summaryrefslogtreecommitdiffstats
path: root/tests/ui/did_you_mean/issue-39544.stderr
blob: 8ccb4cbb0c1672d03b2228d7743e6a3413bdeab0 (plain)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable
  --> $DIR/issue-39544.rs:11:13
   |
LL |     let _ = &mut z.x;
   |             ^^^^^^^^ cannot borrow as mutable
   |
help: consider changing this to be mutable
   |
LL |     let mut z = Z { x: X::Y };
   |         +++

error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
  --> $DIR/issue-39544.rs:16:17
   |
LL |         let _ = &mut self.x;
   |                 ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL |     fn foo<'z>(&'z mut self) {
   |                ~~~~~~~~~~~~

error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
  --> $DIR/issue-39544.rs:20:17
   |
LL |         let _ = &mut self.x;
   |                 ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL |     fn foo1(&mut self, other: &Z) {
   |             ~~~~~~~~~

error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
  --> $DIR/issue-39544.rs:21:17
   |
LL |         let _ = &mut other.x;
   |                 ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL |     fn foo1(&self, other: &mut Z) {
   |                            +++

error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
  --> $DIR/issue-39544.rs:25:17
   |
LL |         let _ = &mut self.x;
   |                 ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL |     fn foo2<'a>(&'a mut self, other: &Z) {
   |                 ~~~~~~~~~~~~

error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
  --> $DIR/issue-39544.rs:26:17
   |
LL |         let _ = &mut other.x;
   |                 ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL |     fn foo2<'a>(&'a self, other: &mut Z) {
   |                                   +++

error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference
  --> $DIR/issue-39544.rs:30:17
   |
LL |         let _ = &mut self.x;
   |                 ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL |     fn foo3<'a>(self: &'a mut Self, other: &Z) {
   |                           +++

error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
  --> $DIR/issue-39544.rs:31:17
   |
LL |         let _ = &mut other.x;
   |                 ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL |     fn foo3<'a>(self: &'a Self, other: &mut Z) {
   |                                         +++

error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference
  --> $DIR/issue-39544.rs:35:17
   |
LL |         let _ = &mut other.x;
   |                 ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL |     fn foo4(other: &mut Z) {
   |                     +++

error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable
  --> $DIR/issue-39544.rs:41:13
   |
LL |     let _ = &mut z.x;
   |             ^^^^^^^^ cannot borrow as mutable
   |
help: consider changing this to be mutable
   |
LL | pub fn with_arg(mut z: Z, w: &Z) {
   |                 +++

error[E0596]: cannot borrow `w.x` as mutable, as it is behind a `&` reference
  --> $DIR/issue-39544.rs:42:13
   |
LL |     let _ = &mut w.x;
   |             ^^^^^^^^ `w` is a `&` reference, so the data it refers to cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL | pub fn with_arg(z: Z, w: &mut Z) {
   |                           +++

error[E0594]: cannot assign to `*x.0`, which is behind a `&` reference
  --> $DIR/issue-39544.rs:48:5
   |
LL |     *x.0 = 1;
   |     ^^^^^^^^ cannot assign

error: aborting due to 12 previous errors

Some errors have detailed explanations: E0594, E0596.
For more information about an error, try `rustc --explain E0594`.