]> git.proxmox.com Git - rustc.git/blame - src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / borrowck / bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr
CommitLineData
74b04a01 1error: cannot borrow value as mutable because it is also borrowed as immutable
94222f64 2 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:36:9
74b04a01
XL
3 |
4LL | ref foo @ [.., ref mut bar] => (),
5 | -------^^^^^^^^-----------^
6 | | |
7 | | mutable borrow, by `bar`, occurs here
8 | immutable borrow, by `foo`, occurs here
9
10error: cannot borrow value as mutable because it is also borrowed as immutable
94222f64 11 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:120:9
74b04a01
XL
12 |
13LL | ref foo @ Some(box ref mut s) => (),
14 | -------^^^^^^^^^^^^---------^
15 | | |
16 | | mutable borrow, by `s`, occurs here
17 | immutable borrow, by `foo`, occurs here
18
19error[E0382]: borrow of moved value: `x`
94222f64 20 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:18:5
74b04a01
XL
21 |
22LL | fn bindings_after_at_slice_patterns_move_binding(x: [String; 4]) {
1b1a35ee 23 | - move occurs because `x` has type `[String; 4]`, which does not implement the `Copy` trait
74b04a01
XL
24LL | match x {
25LL | a @ [.., _] => (),
26 | ----------- value moved here
27...
28LL | &x;
29 | ^^ value borrowed here after move
30
31error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
94222f64 32 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:28:5
74b04a01
XL
33 |
34LL | ref mut foo @ [.., _] => Some(foo),
35 | --------------------- mutable borrow occurs here
36...
37LL | &x;
38 | ^^ immutable borrow occurs here
39...
40LL | drop(r);
41 | - mutable borrow later used here
42
43error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
94222f64 44 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:50:5
74b04a01
XL
45 |
46LL | [ref foo @ .., ref bar] => Some(foo),
47 | ------------ immutable borrow occurs here
48...
49LL | &mut x;
50 | ^^^^^^ mutable borrow occurs here
51...
52LL | drop(r);
53 | - immutable borrow later used here
54
55error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
94222f64 56 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:62:5
74b04a01
XL
57 |
58LL | ref foo @ [.., ref bar] => Some(foo),
59 | ----------------------- immutable borrow occurs here
60...
61LL | &mut x;
62 | ^^^^^^ mutable borrow occurs here
63...
64LL | drop(r);
65 | - immutable borrow later used here
66
67error[E0382]: borrow of moved value: `x`
94222f64 68 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:76:5
74b04a01
XL
69 |
70LL | fn bindings_after_at_or_patterns_move(x: Option<Test>) {
1b1a35ee 71 | - move occurs because `x` has type `Option<Test>`, which does not implement the `Copy` trait
74b04a01
XL
72LL | match x {
73LL | foo @ Some(Test::Foo | Test::Bar) => (),
74 | ---------------------------------
75 | |
76 | value moved here
77 | value moved here
78...
79LL | &x;
80 | ^^ value borrowed here after move
81
82error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
94222f64 83 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:86:5
74b04a01
XL
84 |
85LL | ref foo @ Some(Test::Foo | Test::Bar) => Some(foo),
86 | ------------------------------------- immutable borrow occurs here
87...
88LL | &mut x;
89 | ^^^^^^ mutable borrow occurs here
90...
91LL | drop(r);
92 | - immutable borrow later used here
93
94error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
94222f64 95 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:98:5
74b04a01
XL
96 |
97LL | ref mut foo @ Some(Test::Foo | Test::Bar) => Some(foo),
98 | ----------------------------------------- mutable borrow occurs here
99...
100LL | &x;
101 | ^^ immutable borrow occurs here
102...
103LL | drop(r);
104 | - mutable borrow later used here
105
106error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
94222f64 107 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:112:5
74b04a01
XL
108 |
109LL | ref foo @ Some(box ref s) => Some(foo),
110 | ------------------------- immutable borrow occurs here
111...
112LL | &mut x;
113 | ^^^^^^ mutable borrow occurs here
114...
115LL | drop(r);
116 | - immutable borrow later used here
117
118error[E0382]: borrow of moved value: `x`
94222f64 119 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:134:5
74b04a01
XL
120 |
121LL | fn bindings_after_at_slice_patterns_or_patterns_moves(x: [Option<Test>; 4]) {
1b1a35ee 122 | - move occurs because `x` has type `[Option<Test>; 4]`, which does not implement the `Copy` trait
74b04a01
XL
123LL | match x {
124LL | a @ [.., Some(Test::Foo | Test::Bar)] => (),
125 | -------------------------------------
126 | |
127 | value moved here
128 | value moved here
129...
130LL | &x;
131 | ^^ value borrowed here after move
132
133error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
94222f64 134 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:144:5
74b04a01
XL
135 |
136LL | ref a @ [ref b @ .., Some(Test::Foo | Test::Bar)] => Some(a),
137 | ------------------------------------------------- immutable borrow occurs here
138...
139LL | &mut x;
140 | ^^^^^^ mutable borrow occurs here
141...
142LL | drop(r);
143 | - immutable borrow later used here
144
145error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
94222f64 146 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:156:5
74b04a01
XL
147 |
148LL | ref a @ [ref b @ .., Some(Test::Foo | Test::Bar)] => Some(b),
149 | ---------- immutable borrow occurs here
150...
151LL | &mut x;
152 | ^^^^^^ mutable borrow occurs here
153...
154LL | drop(r);
155 | - immutable borrow later used here
156
157error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
94222f64 158 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:170:5
74b04a01
XL
159 |
160LL | [_, ref a @ Some(box ref b), ..] => Some(a),
161 | ----------------------- immutable borrow occurs here
162...
163LL | &mut x;
164 | ^^^^^^ mutable borrow occurs here
165...
166LL | drop(r);
167 | - immutable borrow later used here
168
169error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
94222f64 170 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:186:5
74b04a01
XL
171 |
172LL | [_, ref a @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
173 | ------------------------------------------- immutable borrow occurs here
174...
175LL | &mut x;
176 | ^^^^^^ mutable borrow occurs here
177...
178LL | drop(r);
179 | - immutable borrow later used here
180
181error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
94222f64 182 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:200:5
74b04a01
XL
183 |
184LL | [_, ref mut a @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
185 | ----------------------------------------------- mutable borrow occurs here
186...
187LL | &x;
188 | ^^ immutable borrow occurs here
189...
190LL | drop(r);
191 | - mutable borrow later used here
192
193error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
94222f64 194 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:214:5
74b04a01
XL
195 |
196LL | ref a @ [_, ref b @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
197 | ------------------------------------------------------------ immutable borrow occurs here
198...
199LL | &mut x;
200 | ^^^^^^ mutable borrow occurs here
201...
202LL | drop(r);
203 | - immutable borrow later used here
204
205error: aborting due to 17 previous errors
206
207Some errors have detailed explanations: E0382, E0502.
208For more information about an error, try `rustc --explain E0382`.