]> git.proxmox.com Git - rustc.git/blob - src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
Update upstream source from tag 'upstream/1.43.0+dfsg1'
[rustc.git] / src / test / ui / pattern / bindings-after-at / borrowck-pat-at-and-box.stderr
1 error: cannot move out of value because it is borrowed
2 --> $DIR/borrowck-pat-at-and-box.rs:37:9
3 |
4 LL | let ref a @ box b = Box::new(NC);
5 | -----^^^^^^^-
6 | | |
7 | | value moved into `b` here
8 | value borrowed, by `a`, here
9
10 error: cannot borrow value as mutable because it is also borrowed as immutable
11 --> $DIR/borrowck-pat-at-and-box.rs:39:9
12 |
13 LL | let ref a @ box ref mut b = Box::new(nc());
14 | -----^^^^^^^---------
15 | | |
16 | | mutable borrow, by `b`, occurs here
17 | immutable borrow, by `a`, occurs here
18
19 error: cannot borrow value as mutable because it is also borrowed as immutable
20 --> $DIR/borrowck-pat-at-and-box.rs:41:9
21 |
22 LL | let ref a @ box ref mut b = Box::new(NC);
23 | -----^^^^^^^---------
24 | | |
25 | | mutable borrow, by `b`, occurs here
26 | immutable borrow, by `a`, occurs here
27
28 error: cannot borrow value as mutable because it is also borrowed as immutable
29 --> $DIR/borrowck-pat-at-and-box.rs:43:9
30 |
31 LL | let ref a @ box ref mut b = Box::new(NC);
32 | -----^^^^^^^---------
33 | | |
34 | | mutable borrow, by `b`, occurs here
35 | immutable borrow, by `a`, occurs here
36
37 error: cannot borrow value as mutable because it is also borrowed as immutable
38 --> $DIR/borrowck-pat-at-and-box.rs:46:9
39 |
40 LL | let ref a @ box ref mut b = Box::new(NC);
41 | -----^^^^^^^---------
42 | | |
43 | | mutable borrow, by `b`, occurs here
44 | immutable borrow, by `a`, occurs here
45
46 error: cannot borrow value as immutable because it is also borrowed as mutable
47 --> $DIR/borrowck-pat-at-and-box.rs:52:9
48 |
49 LL | let ref mut a @ box ref b = Box::new(NC);
50 | ---------^^^^^^^-----
51 | | |
52 | | immutable borrow, by `b`, occurs here
53 | mutable borrow, by `a`, occurs here
54
55 error: cannot borrow value as immutable because it is also borrowed as mutable
56 --> $DIR/borrowck-pat-at-and-box.rs:66:9
57 |
58 LL | ref mut a @ box ref b => {
59 | ---------^^^^^^^-----
60 | | |
61 | | immutable borrow, by `b`, occurs here
62 | mutable borrow, by `a`, occurs here
63
64 error: cannot borrow value as immutable because it is also borrowed as mutable
65 --> $DIR/borrowck-pat-at-and-box.rs:58:11
66 |
67 LL | fn f5(ref mut a @ box ref b: Box<NC>) {
68 | ---------^^^^^^^-----
69 | | |
70 | | immutable borrow, by `b`, occurs here
71 | mutable borrow, by `a`, occurs here
72
73 error[E0382]: use of moved value
74 --> $DIR/borrowck-pat-at-and-box.rs:21:18
75 |
76 LL | let a @ box &b = Box::new(&C);
77 | ---------^ ------------ move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait
78 | | |
79 | | value used here after move
80 | value moved here
81
82 error[E0382]: use of moved value
83 --> $DIR/borrowck-pat-at-and-box.rs:24:17
84 |
85 LL | let a @ box b = Box::new(C);
86 | --------^ ----------- move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
87 | | |
88 | | value used here after move
89 | value moved here
90
91 error[E0382]: use of moved value
92 --> $DIR/borrowck-pat-at-and-box.rs:34:17
93 |
94 LL | match Box::new(C) {
95 | ----------- move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
96 LL | a @ box b => {}
97 | --------^
98 | | |
99 | | value used here after move
100 | value moved here
101
102 error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
103 --> $DIR/borrowck-pat-at-and-box.rs:46:21
104 |
105 LL | let ref a @ box ref mut b = Box::new(NC);
106 | ------------^^^^^^^^^
107 | | |
108 | | mutable borrow occurs here
109 | immutable borrow occurs here
110 ...
111 LL | drop(a);
112 | - immutable borrow later used here
113
114 error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
115 --> $DIR/borrowck-pat-at-and-box.rs:52:25
116 |
117 LL | let ref mut a @ box ref b = Box::new(NC);
118 | ----------------^^^^^
119 | | |
120 | | immutable borrow occurs here
121 | mutable borrow occurs here
122 ...
123 LL | *a = Box::new(NC);
124 | -- mutable borrow later used here
125
126 error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
127 --> $DIR/borrowck-pat-at-and-box.rs:66:25
128 |
129 LL | ref mut a @ box ref b => {
130 | ----------------^^^^^
131 | | |
132 | | immutable borrow occurs here
133 | mutable borrow occurs here
134 ...
135 LL | *a = Box::new(NC);
136 | -- mutable borrow later used here
137
138 error[E0382]: use of moved value
139 --> $DIR/borrowck-pat-at-and-box.rs:27:20
140 |
141 LL | fn f1(a @ box &b: Box<&C>) {}
142 | ---------^
143 | | |
144 | | value used here after move
145 | value moved here
146 | move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait
147
148 error[E0382]: use of moved value
149 --> $DIR/borrowck-pat-at-and-box.rs:30:19
150 |
151 LL | fn f2(a @ box b: Box<C>) {}
152 | --------^
153 | | |
154 | | value used here after move
155 | value moved here
156 | move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
157
158 error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
159 --> $DIR/borrowck-pat-at-and-box.rs:58:27
160 |
161 LL | fn f5(ref mut a @ box ref b: Box<NC>) {
162 | ----------------^^^^^
163 | | |
164 | | immutable borrow occurs here
165 | mutable borrow occurs here
166 ...
167 LL | *a = Box::new(NC);
168 | -- mutable borrow later used here
169
170 error: aborting due to 17 previous errors
171
172 Some errors have detailed explanations: E0382, E0502.
173 For more information about an error, try `rustc --explain E0382`.