Also, the section
TyCtor(
T) to TyCtor(U), where TyCtor(T) is one of
&T&mut T*const T*mut TBox<T>and where
Ucan be obtained fromTby unsized coercion.
Is kinda weird, because it seems to merely try to list the CoerceUnsize in the standard library while being awefully incomplete. I.e. this section appears to be a natural language description of this list of impls
impl<'a, 'b, T, U> CoerceUnsized<&'a U> for &'b T
where
'b: 'a,
T: Unsize<U> + ?Sized,
U: ?Sized,
impl<'a, T, U> CoerceUnsized<&'a mut U> for &'a mut T
where
T: Unsize<U> + ?Sized,
U: ?Sized,
impl<T, U> CoerceUnsized<*const U> for *const T
where
T: Unsize<U> + ?Sized,
U: ?Sized,
impl<T, U> CoerceUnsized<*mut U> for *mut T
where
T: Unsize<U> + ?Sized,
U: ?Sized
impl<T, U, A> CoerceUnsized<Box<U, A>> for Box<T, A>
where
T: Unsize<U> + ?Sized,
A: Allocator,
U: ?Sized,
while the standard library has a lot more CoerceUnsized impls.
Now I’m wondering why the impls for &T and &mut T are different w.r.t. the lifetimes. An oversight?