summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-field-sensitivity.stderr
blob: 11812847dd1813a45c57ef9f15b332a66ae05776 (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
146
147
148
error[E0382]: use of moved value: `x.b`
  --> $DIR/borrowck-field-sensitivity.rs:8:10
   |
LL |     drop(x.b);
   |          --- value moved here
LL |     drop(*x.b);
   |          ^^^^ value used here after move
   |
   = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait

error[E0382]: use of moved value: `x.b`
  --> $DIR/borrowck-field-sensitivity.rs:14:10
   |
LL |     let y = A { a: 3, .. x };
   |             ---------------- value moved here
LL |     drop(*x.b);
   |          ^^^^ value used here after move
   |
   = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait

error[E0382]: borrow of moved value: `x.b`
  --> $DIR/borrowck-field-sensitivity.rs:20:13
   |
LL |     drop(x.b);
   |          --- value moved here
LL |     let p = &x.b;
   |             ^^^^ value borrowed here after move
   |
   = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait

error[E0382]: borrow of moved value: `x.b`
  --> $DIR/borrowck-field-sensitivity.rs:27:13
   |
LL |     let _y = A { a: 3, .. x };
   |              ---------------- value moved here
LL |     let p = &x.b;
   |             ^^^^ value borrowed here after move
   |
   = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait

error[E0505]: cannot move out of `x.b` because it is borrowed
  --> $DIR/borrowck-field-sensitivity.rs:34:10
   |
LL |     let x = A { a: 1, b: Box::new(2) };
   |         - binding `x` declared here
LL |     let p = &x.b;
   |             ---- borrow of `x.b` occurs here
LL |     drop(x.b);
   |          ^^^ move out of `x.b` occurs here
LL |     drop(**p);
   |          --- borrow later used here

error[E0505]: cannot move out of `x.b` because it is borrowed
  --> $DIR/borrowck-field-sensitivity.rs:41:14
   |
LL |     let x = A { a: 1, b: Box::new(2) };
   |         - binding `x` declared here
LL |     let p = &x.b;
   |             ---- borrow of `x.b` occurs here
LL |     let _y = A { a: 3, .. x };
   |              ^^^^^^^^^^^^^^^^ move out of `x.b` occurs here
LL |     drop(**p);
   |          --- borrow later used here

error[E0499]: cannot borrow `x.a` as mutable more than once at a time
  --> $DIR/borrowck-field-sensitivity.rs:48:13
   |
LL |     let p = &mut x.a;
   |             -------- first mutable borrow occurs here
LL |     let q = &mut x.a;
   |             ^^^^^^^^ second mutable borrow occurs here
LL |     drop(*p);
   |          -- first borrow later used here

error[E0382]: use of moved value: `x.b`
  --> $DIR/borrowck-field-sensitivity.rs:56:10
   |
LL |     drop(x.b);
   |          --- value moved here
LL |     drop(x.b);
   |          ^^^ value used here after move
   |
   = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait

error[E0382]: use of moved value: `x.b`
  --> $DIR/borrowck-field-sensitivity.rs:62:10
   |
LL |     let _y = A { a: 3, .. x };
   |              ---------------- value moved here
LL |     drop(x.b);
   |          ^^^ value used here after move
   |
   = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait

error[E0382]: use of moved value: `x.b`
  --> $DIR/borrowck-field-sensitivity.rs:68:14
   |
LL |     drop(x.b);
   |          --- value moved here
LL |     let _z = A { a: 3, .. x };
   |              ^^^^^^^^^^^^^^^^ value used here after move
   |
   = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait

error[E0382]: use of moved value: `x.b`
  --> $DIR/borrowck-field-sensitivity.rs:74:14
   |
LL |     let _y = A { a: 3, .. x };
   |              ---------------- value moved here
LL |     let _z = A { a: 4, .. x };
   |              ^^^^^^^^^^^^^^^^ value used here after move
   |
   = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait

error[E0381]: partially assigned binding `x` isn't fully initialized
  --> $DIR/borrowck-field-sensitivity.rs:81:5
   |
LL |     let mut x: A;
   |         ----- binding declared here but left uninitialized
LL |     x.a = 1;
   |     ^^^^^^^ `x` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0381]: partially assigned binding `x` isn't fully initialized
  --> $DIR/borrowck-field-sensitivity.rs:87:5
   |
LL |     let mut x: A;
   |         ----- binding declared here but left uninitialized
LL |     x.a = 1;
   |     ^^^^^^^ `x` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0381]: partially assigned binding `x` isn't fully initialized
  --> $DIR/borrowck-field-sensitivity.rs:94:5
   |
LL |     let mut x: A;
   |         ----- binding declared here but left uninitialized
LL |     x.b = Box::new(1);
   |     ^^^ `x` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error: aborting due to 14 previous errors

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