]> git.proxmox.com Git - rustc.git/blob - src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
Merge tag 'debian/1.49.0+dfsg1-1_exp1' into debian/sid
[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:32: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:35: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:37: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:39: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:43: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:49: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:63: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:55: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]: borrow of moved value
74 --> $DIR/borrowck-pat-at-and-box.rs:32:9
75 |
76 LL | let ref a @ box b = Box::new(NC);
77 | ^^^^^^^^^^^^-
78 | | |
79 | | value moved here
80 | value borrowed here after move
81 |
82 = note: move occurs because value has type `NC`, which does not implement the `Copy` trait
83
84 error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
85 --> $DIR/borrowck-pat-at-and-box.rs:39:9
86 |
87 LL | let ref a @ box ref mut b = Box::new(NC);
88 | ^^^^^^^^^^^^---------
89 | | |
90 | | mutable borrow occurs here
91 | immutable borrow occurs here
92 ...
93 LL | *b = NC;
94 | ------- mutable borrow later used here
95
96 error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
97 --> $DIR/borrowck-pat-at-and-box.rs:43:9
98 |
99 LL | let ref a @ box ref mut b = Box::new(NC);
100 | ^^^^^^^^^^^^---------
101 | | |
102 | | mutable borrow occurs here
103 | immutable borrow occurs here
104 ...
105 LL | *b = NC;
106 | ------- mutable borrow later used here
107
108 error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
109 --> $DIR/borrowck-pat-at-and-box.rs:49:9
110 |
111 LL | let ref mut a @ box ref b = Box::new(NC);
112 | ^^^^^^^^^^^^^^^^-----
113 | | |
114 | | immutable borrow occurs here
115 | mutable borrow occurs here
116 ...
117 LL | drop(b);
118 | - immutable borrow later used here
119
120 error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
121 --> $DIR/borrowck-pat-at-and-box.rs:63:9
122 |
123 LL | ref mut a @ box ref b => {
124 | ^^^^^^^^^^^^^^^^-----
125 | | |
126 | | immutable borrow occurs here
127 | mutable borrow occurs here
128 ...
129 LL | drop(b);
130 | - immutable borrow later used here
131
132 error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
133 --> $DIR/borrowck-pat-at-and-box.rs:55:11
134 |
135 LL | fn f5(ref mut a @ box ref b: Box<NC>) {
136 | ^^^^^^^^^^^^^^^^-----
137 | | |
138 | | immutable borrow occurs here
139 | mutable borrow occurs here
140 ...
141 LL | drop(b);
142 | - immutable borrow later used here
143
144 error: aborting due to 14 previous errors
145
146 Some errors have detailed explanations: E0382, E0502.
147 For more information about an error, try `rustc --explain E0382`.