3 // revisions: default sa
4 //[sa] compile-flags: -Z save-analysis
5 //-^ To make this the regression test for #75962.
7 #![feature(type_alias_impl_trait)]
11 // Reduction to `impl Trait`
19 impl<T> FooLike for Foo<T> {
30 /// `T::Assoc` should be normalized to `()` here.
31 fn foo_pass<T: Trait<Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
36 // Same with lifetimes in the trait
47 /// FIXME(#51525) -- the shorter notation `T::Assoc` winds up referencing `'static` here
48 fn foo2_pass<'a, T: Trait<'a, Assoc = ()> + 'a>()
49 -> impl FooLike<Output = <T as Trait<'a>>::Assoc> + 'a {
53 /// Normalization to type containing bound region.
55 /// FIXME(#51525) -- the shorter notation `T::Assoc` winds up referencing `'static` here
56 fn foo2_pass2<'a, T: Trait<'a, Assoc = &'a ()> + 'a>()
57 -> impl FooLike<Output = <T as Trait<'a>>::Assoc> + 'a {
62 // The same applied to `type Foo = impl Bar`s
68 impl<T> Implemented for T {
80 type Ex = impl Trait<Out = <() as Implemented>::Assoc>;