error: associated type bounds are not allowed within structs, enums, or unions --> $DIR/inside-adt.rs:5:29 | LL | struct S1 { f: dyn Iterator } | ^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions --> $DIR/inside-adt.rs:7:33 | LL | struct S2 { f: Box> } | ^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions --> $DIR/inside-adt.rs:9:29 | LL | struct S3 { f: dyn Iterator } | ^^^^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions --> $DIR/inside-adt.rs:12:26 | LL | enum E1 { V(dyn Iterator) } | ^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions --> $DIR/inside-adt.rs:15:30 | LL | enum E2 { V(Box>) } | ^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions --> $DIR/inside-adt.rs:17:26 | LL | enum E3 { V(dyn Iterator) } | ^^^^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions --> $DIR/inside-adt.rs:21:41 | LL | union U1 { f: ManuallyDrop> } | ^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions --> $DIR/inside-adt.rs:24:45 | LL | union U2 { f: ManuallyDrop>> } | ^^^^^^^^^^ error: associated type bounds are not allowed within structs, enums, or unions --> $DIR/inside-adt.rs:26:41 | LL | union U3 { f: ManuallyDrop> } | ^^^^^^^^^^^^^ error[E0277]: the size for values of type `(dyn Iterator + 'static)` cannot be known at compilation time --> $DIR/inside-adt.rs:12:13 | LL | enum E1 { V(dyn Iterator) } | ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `(dyn Iterator + 'static)` = note: no field of an enum variant may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size | LL | enum E1 { V(&dyn Iterator) } | + help: the `Box` type always has a statically known size and allocates its contents in the heap | LL | enum E1 { V(Box>) } | ++++ + error[E0277]: the size for values of type `(dyn Iterator + 'static)` cannot be known at compilation time --> $DIR/inside-adt.rs:17:13 | LL | enum E3 { V(dyn Iterator) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `(dyn Iterator + 'static)` = note: no field of an enum variant may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size | LL | enum E3 { V(&dyn Iterator) } | + help: the `Box` type always has a statically known size and allocates its contents in the heap | LL | enum E3 { V(Box>) } | ++++ + error[E0277]: the size for values of type `(dyn Iterator + 'static)` cannot be known at compilation time --> $DIR/inside-adt.rs:21:15 | LL | union U1 { f: ManuallyDrop> } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: within `ManuallyDrop<(dyn Iterator + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator + 'static)` = note: required because it appears within the type `ManuallyDrop<(dyn Iterator + 'static)>` = note: no field of a union may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size | LL | union U1 { f: &ManuallyDrop> } | + help: the `Box` type always has a statically known size and allocates its contents in the heap | LL | union U1 { f: Box>> } | ++++ + error[E0277]: the size for values of type `(dyn Iterator + 'static)` cannot be known at compilation time --> $DIR/inside-adt.rs:26:15 | LL | union U3 { f: ManuallyDrop> } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: within `ManuallyDrop<(dyn Iterator + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator + 'static)` = note: required because it appears within the type `ManuallyDrop<(dyn Iterator + 'static)>` = note: no field of a union may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size | LL | union U3 { f: &ManuallyDrop> } | + help: the `Box` type always has a statically known size and allocates its contents in the heap | LL | union U3 { f: Box>> } | ++++ + error: aborting due to 13 previous errors For more information about this error, try `rustc --explain E0277`.