#![feature(associated_type_bounds)] use std::mem::ManuallyDrop; struct S1 { f: dyn Iterator } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions struct S2 { f: Box> } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions struct S3 { f: dyn Iterator } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions enum E1 { V(dyn Iterator) } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions //~| ERROR the size for values of type `(dyn Iterator + 'static)` enum E2 { V(Box>) } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions enum E3 { V(dyn Iterator) } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions //~| ERROR the size for values of type `(dyn Iterator + 'static)` union U1 { f: ManuallyDrop> } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions //~| ERROR the size for values of type `(dyn Iterator + 'static)` union U2 { f: ManuallyDrop>> } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions union U3 { f: ManuallyDrop> } //~^ ERROR associated type bounds are not allowed within structs, enums, or unions //~| ERROR the size for values of type `(dyn Iterator + 'static)` fn main() {}