1 The `DispatchFromDyn` trait was implemented on something which is not a pointer
2 or a newtype wrapper around a pointer.
4 Erroneous code example:
7 #![feature(dispatch_from_dyn)]
8 use std::ops::DispatchFromDyn;
10 struct WrapperExtraField<T> {
15 impl<T, U> DispatchFromDyn<WrapperExtraField<U>> for WrapperExtraField<T>
17 T: DispatchFromDyn<U>,
21 The `DispatchFromDyn` trait currently can only be implemented for
22 builtin pointer types and structs that are newtype wrappers around them
23 — that is, the struct must have only one field (except for`PhantomData`),
24 and that field must itself implement `DispatchFromDyn`.
27 #![feature(dispatch_from_dyn, unsize)]
33 struct Ptr<T: ?Sized>(*const T);
35 impl<T: ?Sized, U: ?Sized> DispatchFromDyn<Ptr<U>> for Ptr<T>
44 #![feature(dispatch_from_dyn)]
52 _phantom: PhantomData<()>,
55 impl<T, U> DispatchFromDyn<Wrapper<U>> for Wrapper<T>
57 T: DispatchFromDyn<U>,