-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
example-1.expanded.rs
140 lines (140 loc) · 5.27 KB
/
example-1.expanded.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
fn foo(x: i32) -> impl Iterator<Item = i32> {
enum __Enum1<__T1, __T2> {
__T1(__T1),
__T2(__T2),
}
impl<__T1, __T2> ::core::iter::Iterator for __Enum1<__T1, __T2>
where
__T1: ::core::iter::Iterator,
__T2: ::core::iter::Iterator<Item = <__T1 as ::core::iter::Iterator>::Item>,
{
type Item = <__T1 as ::core::iter::Iterator>::Item;
#[inline]
fn next(&mut self) -> ::core::option::Option<Self::Item> {
match self {
__Enum1::__T1(x) => <__T1 as ::core::iter::Iterator>::next(x),
__Enum1::__T2(x) => <__T2 as ::core::iter::Iterator>::next(x),
}
}
#[inline]
fn size_hint(&self) -> (usize, ::core::option::Option<usize>) {
match self {
__Enum1::__T1(x) => <__T1 as ::core::iter::Iterator>::size_hint(x),
__Enum1::__T2(x) => <__T2 as ::core::iter::Iterator>::size_hint(x),
}
}
#[inline]
fn count(self) -> usize {
match self {
__Enum1::__T1(x) => <__T1 as ::core::iter::Iterator>::count(x),
__Enum1::__T2(x) => <__T2 as ::core::iter::Iterator>::count(x),
}
}
#[inline]
fn last(self) -> ::core::option::Option<Self::Item> {
match self {
__Enum1::__T1(x) => <__T1 as ::core::iter::Iterator>::last(x),
__Enum1::__T2(x) => <__T2 as ::core::iter::Iterator>::last(x),
}
}
#[inline]
fn nth(&mut self, n: usize) -> ::core::option::Option<Self::Item> {
match self {
__Enum1::__T1(x) => <__T1 as ::core::iter::Iterator>::nth(x, n),
__Enum1::__T2(x) => <__T2 as ::core::iter::Iterator>::nth(x, n),
}
}
#[inline]
#[must_use = "if you really need to exhaust the iterator, consider `.for_each(drop)` instead"]
fn collect<__U: ::core::iter::FromIterator<Self::Item>>(self) -> __U {
match self {
__Enum1::__T1(x) => <__T1 as ::core::iter::Iterator>::collect(x),
__Enum1::__T2(x) => <__T2 as ::core::iter::Iterator>::collect(x),
}
}
#[inline]
fn partition<__U, __F>(self, f: __F) -> (__U, __U)
where
__U: ::core::default::Default + ::core::iter::Extend<Self::Item>,
__F: ::core::ops::FnMut(&Self::Item) -> bool,
{
match self {
__Enum1::__T1(x) => <__T1 as ::core::iter::Iterator>::partition(x, f),
__Enum1::__T2(x) => <__T2 as ::core::iter::Iterator>::partition(x, f),
}
}
#[inline]
fn fold<__U, __F>(self, init: __U, f: __F) -> __U
where
__F: ::core::ops::FnMut(__U, Self::Item) -> __U,
{
match self {
__Enum1::__T1(x) => <__T1 as ::core::iter::Iterator>::fold(x, init, f),
__Enum1::__T2(x) => <__T2 as ::core::iter::Iterator>::fold(x, init, f),
}
}
#[inline]
fn all<__F>(&mut self, f: __F) -> bool
where
__F: ::core::ops::FnMut(Self::Item) -> bool,
{
match self {
__Enum1::__T1(x) => <__T1 as ::core::iter::Iterator>::all(x, f),
__Enum1::__T2(x) => <__T2 as ::core::iter::Iterator>::all(x, f),
}
}
#[inline]
fn any<__F>(&mut self, f: __F) -> bool
where
__F: ::core::ops::FnMut(Self::Item) -> bool,
{
match self {
__Enum1::__T1(x) => <__T1 as ::core::iter::Iterator>::any(x, f),
__Enum1::__T2(x) => <__T2 as ::core::iter::Iterator>::any(x, f),
}
}
#[inline]
fn find<__P>(&mut self, predicate: __P) -> ::core::option::Option<Self::Item>
where
__P: ::core::ops::FnMut(&Self::Item) -> bool,
{
match self {
__Enum1::__T1(x) => <__T1 as ::core::iter::Iterator>::find(x, predicate),
__Enum1::__T2(x) => <__T2 as ::core::iter::Iterator>::find(x, predicate),
}
}
#[inline]
fn find_map<__U, __F>(&mut self, f: __F) -> ::core::option::Option<__U>
where
__F: ::core::ops::FnMut(Self::Item) -> ::core::option::Option<__U>,
{
match self {
__Enum1::__T1(x) => <__T1 as ::core::iter::Iterator>::find_map(x, f),
__Enum1::__T2(x) => <__T2 as ::core::iter::Iterator>::find_map(x, f),
}
}
#[inline]
fn position<__P>(&mut self, predicate: __P) -> ::core::option::Option<usize>
where
__P: ::core::ops::FnMut(Self::Item) -> bool,
{
match self {
__Enum1::__T1(x) => {
<__T1 as ::core::iter::Iterator>::position(x, predicate)
}
__Enum1::__T2(x) => {
<__T2 as ::core::iter::Iterator>::position(x, predicate)
}
}
}
}
match x {
0 => __Enum1::__T1(1..10),
_ => {
__Enum1::__T2(
<[_]>::into_vec(#[rustc_box] ::alloc::boxed::Box::new([5, 10]))
.into_iter(),
)
}
}
}