1 // compile-flags: -Z mir-opt-level=3
3 // revisions: min_tait full_tait in_bindings
4 #![feature(min_type_alias_impl_trait, rustc_attrs)]
5 #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
6 //[full_tait]~^ WARN incomplete
7 #![cfg_attr(in_bindings, feature(impl_trait_in_bindings))]
8 //[in_bindings]~^ WARN incomplete
10 use std::marker::PhantomData;
14 fn my_index(self) -> Self::O;
16 trait MyFrom<T>: Sized {
18 fn my_from(value: T) -> Result<Self, Self::Error>;
23 type DummyT<T> = impl F;
24 fn _dummy_t<T>() -> DummyT<T> {}
26 struct Phantom1<T>(PhantomData<T>);
27 struct Phantom2<T>(PhantomData<T>);
28 struct Scope<T>(Phantom2<DummyT<T>>);
36 impl<T> MyFrom<Phantom2<T>> for Phantom1<T> {
38 fn my_from(_: Phantom2<T>) -> Result<Self, Self::Error> {
43 impl<T: MyFrom<Phantom2<DummyT<U>>>, U> MyIndex<Phantom1<T>> for Scope<U> {
45 fn my_index(self) -> Self::O {
46 MyFrom::my_from(self.0).ok().unwrap()
52 let _pos: Phantom1<DummyT<()>> = Scope::new().my_index();
53 //[min_tait,full_tait]~^ ERROR not permitted here
54 //[in_bindings]~^^ ERROR type annotations needed