News for hackers. Stuff that matters.
Re:Announcing Rust 1.27 by TheCycoONE on Thursday June 21, 2018 @05:46PM (#17369562)
Your example is misleading. If Foo is a trait Box<Foo> and Box<dyn Foo> are the same thing. Impl Foo is for static dispatch.

Illustrating the need to dump the old unqualified syntax.

Re:Announcing Rust 1.27 by weavie on Thursday June 21, 2018 @06:28PM (#17369794)
Ah ok, I'm back to being confused again then!

Is this right:

If Foo is a struct then Box<Foo> is static dispatch. If Foo is a trait Box<dyn Foo> is dynamic dispatch, but then so is Box<Foo> - but that is the regrettable point. So from now on, if Foo is a trait we should be writing Box<dyn Foo>, which is largely syntactic sugar to make the situation more clear?

I don't fully understand what the release notes are saying about using impl Trait. When would you use Box<impl Foo> vs Box<dyn Foo>?

Re:Announcing Rust 1.27 by steveklabnik on Thursday June 21, 2018 @06:35PM (#17369828)
You are right.

It’s not that you would use Box<impl Foo>, but when taking about the two features, it’s easier to compare them, as they’re actually distinct syntactically.

Re:Announcing Rust 1.27 by weavie on Friday June 22, 2018 @04:00AM (#17372289)
Thankyou.