trait Foo {} trait Bar {} trait Iterable { type Item; } struct Container> { //~^ ERROR `impl Trait` only allowed in function and inherent method return types field: T } enum Enum> { //~^ ERROR `impl Trait` only allowed in function and inherent method return types A(T), } union Union + Copy> { //~^ ERROR `impl Trait` only allowed in function and inherent method return types x: T, } type Type> = T; //~^ ERROR `impl Trait` only allowed in function and inherent method return types fn main() { }