Vector of objects belonging to a trait

Vec<Animal> is not legal, but the compiler can’t tell you that because the type mismatch somehow hides it. If we remove the calls to push, the compiler gives us the following error: <anon>:22:9: 22:40 error: instantiating a type parameter with an incompatible type `Animal`, which does not fulfill `Sized` [E0144] <anon>:22 let mut v: Vec<Animal> … Read more