Problems with "dyn* Trait"

Most of this comment is just nits.

Probably irrelevant to this topic, but this has never been true.

Box<dyn Trait> bounds are more nuanced than that.

While true from a subtype perspective, Unsize coercion can make 'b act covariantly (search for "Interaction with object coercion"). [1] This doesn't matter when the lifetimes are intertwined with others in the signature, as you note.

How would that be phased in considering these currently-non-overlapping implementations?

impl<T /* : Sized */> Trait for [T] {}
impl<T /* : Sized */> Trait for T {}
impl Trait for dyn Display {}

  1. And maybe the coercion makes the subtype distinction meaningless. ↩︎

2 Likes