]>
Commit | Line | Data |
---|---|---|
f035d41b XL |
1 | // Regression test for #57188 |
2 | ||
3 | // check-pass | |
4 | ||
353b0b11 | 5 | #![feature(impl_trait_in_assoc_type)] |
f035d41b XL |
6 | |
7 | struct Baz<'a> { | |
8 | source: &'a str, | |
9 | } | |
10 | ||
11 | trait Foo<'a> { | |
12 | type T: Iterator<Item = Baz<'a>> + 'a; | |
13 | fn foo(source: &'a str) -> Self::T; | |
14 | } | |
15 | ||
16 | struct Bar; | |
17 | impl<'a> Foo<'a> for Bar { | |
18 | type T = impl Iterator<Item = Baz<'a>> + 'a; | |
19 | fn foo(source: &'a str) -> Self::T { | |
20 | std::iter::once(Baz { source }) | |
21 | } | |
22 | } | |
23 | ||
24 | fn main() {} |