summaryrefslogtreecommitdiffstats
path: root/src/test/ui/impl-trait/nested-return-type.rs
blob: 7d7a084b89046ca64f759f3c455cd7ac8c0ee6e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Check that nested impl Trait items work in functions with generic parameters.
// check-pass

trait Captures<'a> {}

impl<T> Captures<'_> for T {}

fn nested_assoc_type<'a: 'a, T>() -> impl Iterator<Item = impl Sized> {
    [1].iter()
}

fn nested_assoc_lifetime<'a: 'a, T>() -> impl Iterator<Item = impl Captures<'a>> {
    [1].iter()
}

fn main() {}