]> git.proxmox.com Git - rustc.git/blob - src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
New upstream version 1.67.1+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:31: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:34: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:36: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:38: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:42: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:48: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:62: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:54: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:31:9
75 |
76 LL | let ref a @ box b = Box::new(NC);
77 | ^^^^^ - value moved here
78 | |
79 | value borrowed here after move
80 |
81 = note: move occurs because value has type `NC`, which does not implement the `Copy` trait
82 help: borrow this binding in the pattern to avoid moving the value
83 |
84 LL | let ref a @ box ref b = Box::new(NC);
85 | +++
86
87 error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
88 --> $DIR/borrowck-pat-at-and-box.rs:38:9
89 |
90 LL | let ref a @ box ref mut b = Box::new(NC);
91 | ^^^^^ --------- mutable borrow occurs here
92 | |
93 | immutable borrow occurs here
94 ...
95 LL | *b = NC;
96 | ------- mutable borrow later used here
97
98 error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
99 --> $DIR/borrowck-pat-at-and-box.rs:42:9
100 |
101 LL | let ref a @ box ref mut b = Box::new(NC);
102 | ^^^^^ --------- mutable borrow occurs here
103 | |
104 | immutable borrow occurs here
105 ...
106 LL | *b = NC;
107 | ------- mutable borrow later used here
108
109 error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
110 --> $DIR/borrowck-pat-at-and-box.rs:48:9
111 |
112 LL | let ref mut a @ box ref b = Box::new(NC);
113 | ^^^^^^^^^ ----- immutable borrow occurs here
114 | |
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:62:9
122 |
123 LL | ref mut a @ box ref b => {
124 | ^^^^^^^^^ ----- immutable borrow occurs here
125 | |
126 | mutable borrow occurs here
127 ...
128 LL | drop(b);
129 | - immutable borrow later used here
130
131 error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
132 --> $DIR/borrowck-pat-at-and-box.rs:54:11
133 |
134 LL | fn f5(ref mut a @ box ref b: Box<NC>) {
135 | ^^^^^^^^^ ----- immutable borrow occurs here
136 | |
137 | mutable borrow occurs here
138 ...
139 LL | drop(b);
140 | - immutable borrow later used here
141
142 error: aborting due to 14 previous errors
143
144 Some errors have detailed explanations: E0382, E0502.
145 For more information about an error, try `rustc --explain E0382`.