]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-field-sensitivity.stderr
Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors
[rust.git] / tests / ui / borrowck / borrowck-field-sensitivity.stderr
1 error[E0382]: use of moved value: `x.b`
2   --> $DIR/borrowck-field-sensitivity.rs:8:10
3    |
4 LL |     drop(x.b);
5    |          --- value moved here
6 LL |     drop(*x.b);
7    |          ^^^^ value used here after move
8    |
9    = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
10
11 error[E0382]: use of moved value: `x.b`
12   --> $DIR/borrowck-field-sensitivity.rs:14:10
13    |
14 LL |     let y = A { a: 3, .. x };
15    |             ---------------- value moved here
16 LL |     drop(*x.b);
17    |          ^^^^ value used here after move
18    |
19    = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
20
21 error[E0382]: borrow of moved value: `x.b`
22   --> $DIR/borrowck-field-sensitivity.rs:20:13
23    |
24 LL |     drop(x.b);
25    |          --- value moved here
26 LL |     let p = &x.b;
27    |             ^^^^ value borrowed here after move
28    |
29    = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
30
31 error[E0382]: borrow of moved value: `x.b`
32   --> $DIR/borrowck-field-sensitivity.rs:27:13
33    |
34 LL |     let _y = A { a: 3, .. x };
35    |              ---------------- value moved here
36 LL |     let p = &x.b;
37    |             ^^^^ value borrowed here after move
38    |
39    = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
40
41 error[E0505]: cannot move out of `x.b` because it is borrowed
42   --> $DIR/borrowck-field-sensitivity.rs:34:10
43    |
44 LL |     let p = &x.b;
45    |             ---- borrow of `x.b` occurs here
46 LL |     drop(x.b);
47    |          ^^^ move out of `x.b` occurs here
48 LL |     drop(**p);
49    |          --- borrow later used here
50
51 error[E0505]: cannot move out of `x.b` because it is borrowed
52   --> $DIR/borrowck-field-sensitivity.rs:41:14
53    |
54 LL |     let p = &x.b;
55    |             ---- borrow of `x.b` occurs here
56 LL |     let _y = A { a: 3, .. x };
57    |              ^^^^^^^^^^^^^^^^ move out of `x.b` occurs here
58 LL |     drop(**p);
59    |          --- borrow later used here
60
61 error[E0499]: cannot borrow `x.a` as mutable more than once at a time
62   --> $DIR/borrowck-field-sensitivity.rs:48:13
63    |
64 LL |     let p = &mut x.a;
65    |             -------- first mutable borrow occurs here
66 LL |     let q = &mut x.a;
67    |             ^^^^^^^^ second mutable borrow occurs here
68 LL |     drop(*p);
69    |          -- first borrow later used here
70
71 error[E0382]: use of moved value: `x.b`
72   --> $DIR/borrowck-field-sensitivity.rs:56:10
73    |
74 LL |     drop(x.b);
75    |          --- value moved here
76 LL |     drop(x.b);
77    |          ^^^ value used here after move
78    |
79    = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
80
81 error[E0382]: use of moved value: `x.b`
82   --> $DIR/borrowck-field-sensitivity.rs:62:10
83    |
84 LL |     let _y = A { a: 3, .. x };
85    |              ---------------- value moved here
86 LL |     drop(x.b);
87    |          ^^^ value used here after move
88    |
89    = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
90
91 error[E0382]: use of moved value: `x.b`
92   --> $DIR/borrowck-field-sensitivity.rs:68:14
93    |
94 LL |     drop(x.b);
95    |          --- value moved here
96 LL |     let _z = A { a: 3, .. x };
97    |              ^^^^^^^^^^^^^^^^ value used here after move
98    |
99    = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
100
101 error[E0382]: use of moved value: `x.b`
102   --> $DIR/borrowck-field-sensitivity.rs:74:14
103    |
104 LL |     let _y = A { a: 3, .. x };
105    |              ---------------- value moved here
106 LL |     let _z = A { a: 4, .. x };
107    |              ^^^^^^^^^^^^^^^^ value used here after move
108    |
109    = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
110
111 error[E0381]: partially assigned binding `x` isn't fully initialized
112   --> $DIR/borrowck-field-sensitivity.rs:81:5
113    |
114 LL |     let mut x: A;
115    |         ----- binding declared here but left uninitialized
116 LL |     x.a = 1;
117    |     ^^^^^^^ `x` partially assigned here but it isn't fully initialized
118    |
119    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
120
121 error[E0381]: partially assigned binding `x` isn't fully initialized
122   --> $DIR/borrowck-field-sensitivity.rs:87:5
123    |
124 LL |     let mut x: A;
125    |         ----- binding declared here but left uninitialized
126 LL |     x.a = 1;
127    |     ^^^^^^^ `x` partially assigned here but it isn't fully initialized
128    |
129    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
130
131 error[E0381]: partially assigned binding `x` isn't fully initialized
132   --> $DIR/borrowck-field-sensitivity.rs:94:5
133    |
134 LL |     let mut x: A;
135    |         ----- binding declared here but left uninitialized
136 LL |     x.b = Box::new(1);
137    |     ^^^ `x` partially assigned here but it isn't fully initialized
138    |
139    = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
140
141 error: aborting due to 14 previous errors
142
143 Some errors have detailed explanations: E0381, E0382, E0499, E0505.
144 For more information about an error, try `rustc --explain E0381`.