News for hackers. Stuff that matters.
Re:RustBelt: securing the foundations of the Rust programmin... by lambda on Sunday February 04, 2018 @12:52PM (#16303805)
Sorry, you are right about that. You can have trait objects without an allocator.

I'm not sure how common a pattern that is. Many people like to avoid trait objects and just parameterize the function on a type bounded by the trait in that case. And impl Trait is replacing some of the other cases in which you had to return an allocated trait object.

Anyhow, you're right, I was wrong that people couldn't be using trait objects in an embedded context with no allocator, but I also think it's perfectly reasonable to write in a subset of Rust in which you don't use trait objects at all.

Re:RustBelt: securing the foundations of the Rust programmin... by Argorak on Sunday February 04, 2018 @03:14PM (#16304639)
Taking a trait object by reference is a pretty common pattern.

Box<Trait> is so pervasive because it's currently the easiest way to get type erasure in return position.