]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/issue-81199.stderr
Rollup merge of #93354 - sunfishcode:sunfishcode/document-borrowedfd-toowned, r=josht...
[rust.git] / src / test / ui / union / issue-81199.stderr
1 error[E0277]: the trait bound `T: Pointee` is not satisfied in `PtrComponents<T>`
2   --> $DIR/issue-81199.rs:5:17
3    |
4 LL |     components: PtrComponents<T>,
5    |                 ^^^^^^^^^^^^^^^^ within `PtrComponents<T>`, the trait `Pointee` is not implemented for `T`
6    |
7 note: required because it appears within the type `PtrComponents<T>`
8   --> $DIR/issue-81199.rs:10:8
9    |
10 LL | struct PtrComponents<T: Pointee + ?Sized> {
11    |        ^^^^^^^^^^^^^
12    = note: no field of a union may have a dynamically sized type
13    = help: change the field's type to have a statically known size
14 help: consider further restricting this bound
15    |
16 LL | union PtrRepr<T: ?Sized + Pointee> {
17    |                         +++++++++
18 help: borrowed types always have a statically known size
19    |
20 LL |     components: &PtrComponents<T>,
21    |                 +
22 help: the `Box` type always has a statically known size and allocates its contents in the heap
23    |
24 LL |     components: Box<PtrComponents<T>>,
25    |                 ++++                +
26
27 error: aborting due to previous error
28
29 For more information about this error, try `rustc --explain E0277`.