• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // check-pass
2 // Regression test for issue #67844
3 // Ensures that we properly handle nested TAIT occurrences
4 // with generic parameters
5 
6 #![feature(type_alias_impl_trait)]
7 
8 trait WithAssoc {
9     type AssocType;
10 }
11 
12 trait WithParam<A> {}
13 
14 type Return<A> = impl WithAssoc<AssocType = impl WithParam<A>>;
15 
16 struct MyParam;
17 impl<A> WithParam<A> for MyParam {}
18 
19 struct MyStruct;
20 
21 impl WithAssoc for MyStruct {
22     type AssocType = MyParam;
23 }
24 
my_fun<A>() -> Return<A>25 fn my_fun<A>() -> Return<A> {
26     MyStruct
27 }
28 
my_other_fn<A>() -> impl WithAssoc<AssocType = impl WithParam<A>>29 fn my_other_fn<A>() -> impl WithAssoc<AssocType = impl WithParam<A>> {
30     MyStruct
31 }
32 
main()33 fn main() {}
34