summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
blob: f27df32ccfa5ce2afbe63b73b2f62255371b7228 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
error: cannot move out of value because it is borrowed
  --> $DIR/borrowck-pat-at-and-box.rs:31:9
   |
LL |     let ref a @ box b = Box::new(NC);
   |         -----^^^^^^^-
   |         |           |
   |         |           value moved into `b` here
   |         value borrowed, by `a`, here

error: cannot borrow value as mutable because it is also borrowed as immutable
  --> $DIR/borrowck-pat-at-and-box.rs:34:9
   |
LL |     let ref a @ box ref mut b = Box::new(nc());
   |         -----^^^^^^^---------
   |         |           |
   |         |           mutable borrow, by `b`, occurs here
   |         immutable borrow, by `a`, occurs here

error: cannot borrow value as mutable because it is also borrowed as immutable
  --> $DIR/borrowck-pat-at-and-box.rs:36:9
   |
LL |     let ref a @ box ref mut b = Box::new(NC);
   |         -----^^^^^^^---------
   |         |           |
   |         |           mutable borrow, by `b`, occurs here
   |         immutable borrow, by `a`, occurs here

error: cannot borrow value as mutable because it is also borrowed as immutable
  --> $DIR/borrowck-pat-at-and-box.rs:38:9
   |
LL |     let ref a @ box ref mut b = Box::new(NC);
   |         -----^^^^^^^---------
   |         |           |
   |         |           mutable borrow, by `b`, occurs here
   |         immutable borrow, by `a`, occurs here

error: cannot borrow value as mutable because it is also borrowed as immutable
  --> $DIR/borrowck-pat-at-and-box.rs:42:9
   |
LL |     let ref a @ box ref mut b = Box::new(NC);
   |         -----^^^^^^^---------
   |         |           |
   |         |           mutable borrow, by `b`, occurs here
   |         immutable borrow, by `a`, occurs here

error: cannot borrow value as immutable because it is also borrowed as mutable
  --> $DIR/borrowck-pat-at-and-box.rs:48:9
   |
LL |     let ref mut a @ box ref b = Box::new(NC);
   |         ---------^^^^^^^-----
   |         |               |
   |         |               immutable borrow, by `b`, occurs here
   |         mutable borrow, by `a`, occurs here

error: cannot borrow value as immutable because it is also borrowed as mutable
  --> $DIR/borrowck-pat-at-and-box.rs:62:9
   |
LL |         ref mut a @ box ref b => {
   |         ---------^^^^^^^-----
   |         |               |
   |         |               immutable borrow, by `b`, occurs here
   |         mutable borrow, by `a`, occurs here

error: cannot borrow value as immutable because it is also borrowed as mutable
  --> $DIR/borrowck-pat-at-and-box.rs:54:11
   |
LL |     fn f5(ref mut a @ box ref b: Box<NC>) {
   |           ---------^^^^^^^-----
   |           |               |
   |           |               immutable borrow, by `b`, occurs here
   |           mutable borrow, by `a`, occurs here

error[E0382]: borrow of moved value
  --> $DIR/borrowck-pat-at-and-box.rs:31:9
   |
LL |     let ref a @ box b = Box::new(NC);
   |         ^^^^^       - value moved here
   |         |
   |         value borrowed here after move
   |
   = note: move occurs because value has type `NC`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
   |
LL |     let ref a @ box ref b = Box::new(NC);
   |                     +++

error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
  --> $DIR/borrowck-pat-at-and-box.rs:38:9
   |
LL |     let ref a @ box ref mut b = Box::new(NC);
   |         ^^^^^       --------- mutable borrow occurs here
   |         |
   |         immutable borrow occurs here
...
LL |     *b = NC;
   |     ------- mutable borrow later used here

error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
  --> $DIR/borrowck-pat-at-and-box.rs:42:9
   |
LL |     let ref a @ box ref mut b = Box::new(NC);
   |         ^^^^^       --------- mutable borrow occurs here
   |         |
   |         immutable borrow occurs here
...
LL |     *b = NC;
   |     ------- mutable borrow later used here

error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
  --> $DIR/borrowck-pat-at-and-box.rs:48:9
   |
LL |     let ref mut a @ box ref b = Box::new(NC);
   |         ^^^^^^^^^       ----- immutable borrow occurs here
   |         |
   |         mutable borrow occurs here
...
LL |     drop(b);
   |          - immutable borrow later used here

error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
  --> $DIR/borrowck-pat-at-and-box.rs:62:9
   |
LL |         ref mut a @ box ref b => {
   |         ^^^^^^^^^       ----- immutable borrow occurs here
   |         |
   |         mutable borrow occurs here
...
LL |             drop(b);
   |                  - immutable borrow later used here

error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
  --> $DIR/borrowck-pat-at-and-box.rs:54:11
   |
LL |     fn f5(ref mut a @ box ref b: Box<NC>) {
   |           ^^^^^^^^^       ----- immutable borrow occurs here
   |           |
   |           mutable borrow occurs here
...
LL |         drop(b);
   |              - immutable borrow later used here

error: aborting due to 14 previous errors

Some errors have detailed explanations: E0382, E0502.
For more information about an error, try `rustc --explain E0382`.