]> git.proxmox.com Git - rustc.git/blob - src/test/ui/type-alias-impl-trait/issue-58887.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / issue-58887.rs
1 // run-pass
2
3 // revisions: min_tait full_tait
4 #![feature(min_type_alias_impl_trait)]
5 #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
6 //[full_tait]~^ WARN incomplete
7
8 trait UnwrapItemsExt {
9 type Iter;
10 fn unwrap_items(self) -> Self::Iter;
11 }
12
13 impl<I, T, E> UnwrapItemsExt for I
14 where
15 I: Iterator<Item = Result<T, E>>,
16 E: std::fmt::Debug,
17 {
18 type Iter = impl Iterator<Item = T>;
19
20 fn unwrap_items(self) -> Self::Iter {
21 self.map(|x| x.unwrap())
22 }
23 }
24
25 fn main() {}