]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/issue-58887.rs
Auto merge of #106503 - cjgillot:remap-nofilter, r=oli-obk
[rust.git] / tests / ui / type-alias-impl-trait / issue-58887.rs
1 // run-pass
2
3 #![feature(type_alias_impl_trait)]
4
5 trait UnwrapItemsExt {
6     type Iter;
7     fn unwrap_items(self) -> Self::Iter;
8 }
9
10 impl<I, T, E> UnwrapItemsExt for I
11 where
12     I: Iterator<Item = Result<T, E>>,
13     E: std::fmt::Debug,
14 {
15     type Iter = impl Iterator<Item = T>;
16
17     fn unwrap_items(self) -> Self::Iter {
18         self.map(|x| x.unwrap())
19     }
20 }
21
22 fn main() {}