Closed
Description
Currently if Trait1
and Trait2
are traits, then &mut Trait1+Trait2 <: &mut Trait1
. I.e., mutable trait objects are covariant. All other mutable references are invariant, that is &mut T <: &mut T'
iff T /equiv T'
.
Should trait objects also be invariant?
See also #12470, which is a similar issue but about lifetimes in the same situation (which must be invariant and not contravariant).