1 #![feature(unsize, coerce_unsized)]
3 // Verfies that non-PhantomData ZSTs still cause coercions to fail.
4 // They might have additional semantics that we don't want to bulldoze.
6 use std::marker::{Unsize, PhantomData};
7 use std::ops::CoerceUnsized;
9 struct NotPhantomData<T: ?Sized>(PhantomData<T>);
11 struct MyRc<T: ?Sized> {
13 _boo: NotPhantomData<T>,
16 impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<MyRc<U>> for MyRc<T>{ } //~ERROR
20 let iter = data.iter();
21 let x = MyRc { _ptr: &iter, _boo: NotPhantomData(PhantomData) };
22 let _y: MyRc<dyn Iterator<Item=&u32>> = x;