]> git.proxmox.com Git - rustc.git/blob - src/test/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs
New upstream version 1.46.0~beta.2+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / issue-57188-associate-impl-capture.rs
1 // Regression test for #57188
2
3 // check-pass
4
5 #![feature(type_alias_impl_trait)]
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() {}