summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/issue-58887.rs
blob: 96ac7860283ac3b6f63e53dbd34def8a7095ccae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// run-pass

#![feature(type_alias_impl_trait)]

trait UnwrapItemsExt {
    type Iter;
    fn unwrap_items(self) -> Self::Iter;
}

impl<I, T, E> UnwrapItemsExt for I
where
    I: Iterator<Item = Result<T, E>>,
    E: std::fmt::Debug,
{
    type Iter = impl Iterator<Item = T>;

    fn unwrap_items(self) -> Self::Iter {
        self.map(|x| x.unwrap())
    }
}

fn main() {}