1 // ignore-test: This now ICEs again.
5 #![feature(type_alias_impl_trait)]
7 use std::marker::PhantomData;
9 /* copied Index and TryFrom for convenience (and simplicity) */
12 fn my_index(self) -> Self::O;
14 trait MyFrom<T>: Sized {
16 fn my_from(value: T) -> Result<Self, Self::Error>;
19 /* MCVE starts here */
22 type DummyT<T> = impl F;
23 fn _dummy_t<T>() -> DummyT<T> {}
25 struct Phantom1<T>(PhantomData<T>);
26 struct Phantom2<T>(PhantomData<T>);
27 struct Scope<T>(Phantom2<DummyT<T>>);
35 impl<T> MyFrom<Phantom2<T>> for Phantom1<T> {
37 fn my_from(_: Phantom2<T>) -> Result<Self, Self::Error> {
42 impl<T: MyFrom<Phantom2<DummyT<U>>>, U> MyIndex<Phantom1<T>> for Scope<U> {
44 fn my_index(self) -> Self::O {
45 MyFrom::my_from(self.0).ok().unwrap()
50 let _pos: Phantom1<DummyT<()>> = Scope::new().my_index();