]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/nested-return-type.rs
Auto merge of #95604 - nbdd0121:used2, r=petrochenkov
[rust.git] / src / test / ui / impl-trait / nested-return-type.rs
1 // Check that nested impl Trait items work in functions with generic parameters.
2 // check-pass
3
4 trait Captures<'a> {}
5
6 impl<T> Captures<'_> for T {}
7
8 fn nested_assoc_type<'a: 'a, T>() -> impl Iterator<Item = impl Sized> {
9     [1].iter()
10 }
11
12 fn nested_assoc_lifetime<'a: 'a, T>() -> impl Iterator<Item = impl Captures<'a>> {
13     [1].iter()
14 }
15
16 fn main() {}