Recently I found a case where rust's type inference fails for collections of trait objects. Here an example: use std::fmt::Debug; #[derive(Debug)] struct D1; #[derive(Debug)] struct D2; fn debug_vec() -> Vec> { // compiler: hmm, I don't know what type this is. Let's see how this one // unfolds. let mut v = Vec::new(); // compiler: got it, v must be Vec>! v.push(Box::new(D1)); // compiler: gosh darn it, this is no Box add...| The Rust Programming Language Forum
[subtype]| doc.rust-lang.org
[items.traits]| doc.rust-lang.org
[expr.method]| doc.rust-lang.org
Glossary| doc.rust-lang.org
Destructors| doc.rust-lang.org
[lifetime-elision]| doc.rust-lang.org
`as` is easy, convenient, and maybe not something to use| Anna Hope
The essentials of the Rust programming language in one post| GeekLaunch
Diagnostic attributes| doc.rust-lang.org