Description
One of the big problems with the 2015-style trait object syntax (no dyn
) was that users often write things like impl Iterator for MyTrait { }
when what they really meant was impl<T: MyTrait> Iterator for T { }
. Back then, the error message would more often than not be some inscrutable message about Sized
, which would send them on a wild goose chase of adding Sized
bounds everywhere they could think of, leading to even more inscrutable messages.
Now, the error message is clearer: it tells users they need to add dyn
for a trait object type. However, I find in many cases (most cases?) this is not what users actually want - what they actually want is the blanket impl. It would be helpful to have a note suggesting the correct syntax for a blanket impl, or better yet just presenting both correct syntaxes (impl for trait object and blanket impl) on equal footing and making it clear the difference between them.