Subtyping is maybe a step too controversial as it greatly extends the scope of subtyping in Rust (currently it’s only about lifetimes). Coercions, or “upcasting” of trait object pointers, would be a more minimal first step that would allow a lot of things, just not reinterpretation of e.g. &[&dyn SubTrait]
as &[&dyn SuperTrait]
. (This was discussed in discord, bringing it here for completeness.)
10 Likes