Closed
Description
In order not have a tonne of coherence errors, we currently do not unify unsized types with type variables in type inference. For example, [T]
with U
. This mimics our old behaviour where unsized types were not types.
This prevents us having an impl for &T
which will use an impl for [T]
, i.e., we need a separate impl for &[T]
. This is one of the primary benefits of DST. It also causes problems when the compiler needs to infer a DST for a type parameter, e.g., in function calls. See #17122 for one example.