summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs
blob: 3a7a5da075f11b841922ceeca209f97ebf952537 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Regression test for #57188

// check-pass

#![feature(type_alias_impl_trait)]

struct Baz<'a> {
    source: &'a str,
}

trait Foo<'a> {
    type T: Iterator<Item = Baz<'a>> + 'a;
    fn foo(source: &'a str) -> Self::T;
}

struct Bar;
impl<'a> Foo<'a> for Bar {
    type T = impl Iterator<Item = Baz<'a>> + 'a;
    fn foo(source: &'a str) -> Self::T {
        std::iter::once(Baz { source })
    }
}

fn main() {}