]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / ui / type-alias-impl-trait / issue-69136-inner-lifetime-resolve-error.rs
1 // Regression test for #69136
2
3 #![feature(type_alias_impl_trait)]
4
5 trait SomeTrait {}
6
7 impl SomeTrait for () {}
8
9 trait WithAssoc<A> {
10     type AssocType;
11 }
12
13 impl<T> WithAssoc<T> for () {
14     type AssocType = ();
15 }
16
17 type Return<A> = impl WithAssoc<A, AssocType = impl SomeTrait + 'a>;
18 //~^ ERROR use of undeclared lifetime name `'a`
19
20 fn my_fun() -> Return<()> {}
21 //~^ ERROR non-defining opaque type use in defining scope
22 //~| ERROR non-defining opaque type use in defining scope
23
24 fn main() {}