]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/match-guards-partially-borrow.stderr
Rollup merge of #107022 - scottmcm:ordering-option-eq, r=m-ou-se
[rust.git] / tests / ui / nll / match-guards-partially-borrow.stderr
1 error[E0510]: cannot assign `q` in match guard
2   --> $DIR/match-guards-partially-borrow.rs:100:13
3    |
4 LL |     match q {
5    |           - value is immutable in match guard
6 ...
7 LL |             q = true;
8    |             ^^^^^^^^ cannot assign
9
10 error[E0510]: cannot assign `q` in match guard
11   --> $DIR/match-guards-partially-borrow.rs:111:13
12    |
13 LL |     match q {
14    |           - value is immutable in match guard
15 ...
16 LL |             q = true;
17    |             ^^^^^^^^ cannot assign
18
19 error[E0510]: cannot assign `r` in match guard
20   --> $DIR/match-guards-partially-borrow.rs:123:13
21    |
22 LL |     match r {
23    |           - value is immutable in match guard
24 ...
25 LL |             r = true;
26    |             ^^^^^^^^ cannot assign
27
28 error[E0510]: cannot assign `r` in match guard
29   --> $DIR/match-guards-partially-borrow.rs:135:13
30    |
31 LL |     match r {
32    |           - value is immutable in match guard
33 ...
34 LL |             r = true;
35    |             ^^^^^^^^ cannot assign
36
37 error[E0510]: cannot assign `t` in match guard
38   --> $DIR/match-guards-partially-borrow.rs:172:13
39    |
40 LL |     match t {
41    |           - value is immutable in match guard
42 ...
43 LL |             t = true;
44    |             ^^^^^^^^ cannot assign
45
46 error[E0510]: cannot assign `t` in match guard
47   --> $DIR/match-guards-partially-borrow.rs:183:13
48    |
49 LL |     match t {
50    |           - value is immutable in match guard
51 ...
52 LL |             t = true;
53    |             ^^^^^^^^ cannot assign
54
55 error[E0510]: cannot mutably borrow `x.0` in match guard
56   --> $DIR/match-guards-partially-borrow.rs:197:22
57    |
58 LL |     match x {
59    |           - value is immutable in match guard
60 ...
61 LL |                 Some(ref mut r) => *r = None,
62    |                      ^^^^^^^^^ cannot mutably borrow
63
64 error[E0510]: cannot mutably borrow `x.0` in match guard
65   --> $DIR/match-guards-partially-borrow.rs:213:22
66    |
67 LL |     match x {
68    |           - value is immutable in match guard
69 ...
70 LL |                 Some(ref mut r) => *r = None,
71    |                      ^^^^^^^^^ cannot mutably borrow
72
73 error[E0506]: cannot assign to `t` because it is borrowed
74   --> $DIR/match-guards-partially-borrow.rs:225:13
75    |
76 LL |         s if {
77    |         - `t` is borrowed here
78 LL |             t = !t;
79    |             ^^^^^^ `t` is assigned to here but it was already borrowed
80 LL |             false
81 LL |         } => (), // What value should `s` have in the arm?
82    |         - borrow later used here
83
84 error[E0506]: cannot assign to `t` because it is borrowed
85   --> $DIR/match-guards-partially-borrow.rs:235:13
86    |
87 LL |         s if let Some(()) = {
88    |         - `t` is borrowed here
89 LL |             t = !t;
90    |             ^^^^^^ `t` is assigned to here but it was already borrowed
91 LL |             None
92 LL |         } => (), // What value should `s` have in the arm?
93    |         - borrow later used here
94
95 error[E0510]: cannot assign `y` in match guard
96   --> $DIR/match-guards-partially-borrow.rs:246:13
97    |
98 LL |     match *y {
99    |           -- value is immutable in match guard
100 ...
101 LL |             y = &true;
102    |             ^^^^^^^^^ cannot assign
103
104 error[E0510]: cannot assign `y` in match guard
105   --> $DIR/match-guards-partially-borrow.rs:257:13
106    |
107 LL |     match *y {
108    |           -- value is immutable in match guard
109 ...
110 LL |             y = &true;
111    |             ^^^^^^^^^ cannot assign
112
113 error[E0510]: cannot assign `z` in match guard
114   --> $DIR/match-guards-partially-borrow.rs:268:13
115    |
116 LL |     match z {
117    |           - value is immutable in match guard
118 ...
119 LL |             z = &true;
120    |             ^^^^^^^^^ cannot assign
121
122 error[E0510]: cannot assign `z` in match guard
123   --> $DIR/match-guards-partially-borrow.rs:279:13
124    |
125 LL |     match z {
126    |           - value is immutable in match guard
127 ...
128 LL |             z = &true;
129    |             ^^^^^^^^^ cannot assign
130
131 error[E0510]: cannot assign `a` in match guard
132   --> $DIR/match-guards-partially-borrow.rs:291:13
133    |
134 LL |     match a {
135    |           - value is immutable in match guard
136 ...
137 LL |             a = &true;
138    |             ^^^^^^^^^ cannot assign
139
140 error[E0510]: cannot assign `a` in match guard
141   --> $DIR/match-guards-partially-borrow.rs:303:13
142    |
143 LL |     match a {
144    |           - value is immutable in match guard
145 ...
146 LL |             a = &true;
147    |             ^^^^^^^^^ cannot assign
148
149 error[E0510]: cannot assign `b` in match guard
150   --> $DIR/match-guards-partially-borrow.rs:314:13
151    |
152 LL |     match b {
153    |           - value is immutable in match guard
154 ...
155 LL |             b = &true;
156    |             ^^^^^^^^^ cannot assign
157
158 error[E0510]: cannot assign `b` in match guard
159   --> $DIR/match-guards-partially-borrow.rs:325:13
160    |
161 LL |     match b {
162    |           - value is immutable in match guard
163 ...
164 LL |             b = &true;
165    |             ^^^^^^^^^ cannot assign
166
167 error: aborting due to 18 previous errors
168
169 Some errors have detailed explanations: E0506, E0510.
170 For more information about an error, try `rustc --explain E0506`.