-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample1.expanded.rs
More file actions
190 lines (190 loc) · 6.87 KB
/
example1.expanded.rs
File metadata and controls
190 lines (190 loc) · 6.87 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#![feature(prelude_import)]
#[prelude_import]
use std::prelude::rust_2021::*;
#[macro_use]
extern crate std;
#[repr(transparent)]
struct Iterator1 {
#[doc(hidden)]
__private_inner: ::stacklover::__private_mod::ErasedStorage<
{ Iterator1::__SIZE },
{ Iterator1::__ALIGN },
>,
}
const _: () = {
type __StackloverWrappedType<__Inner__> = __Inner__;
#[inline(always)]
fn __stacklover_create(
dep1: &'static str,
dep2: i32,
) -> impl Iterator<Item = i32> + Clone {
(1..)
.map(|x| x * 3)
.take_while(|x| *x < 20)
.chain("HELLO".chars().map(|c| c as i32).flat_map(|i| [i, i - 65]))
.chain([dep1.len() as i32, dep2])
}
#[allow(unused)]
#[allow(unreachable_code)]
fn __stacklover_inner_unreachable() -> impl Iterator<Item = i32> + Clone {
let __stacklover_inner_to_struct_fn_unreachable = |inner| -> Iterator1 {
::core::panicking::panic("internal error: entered unreachable code")
};
let _ = {
let created_value = __stacklover_create(
::core::panicking::panic("internal error: entered unreachable code"),
::core::panicking::panic("internal error: entered unreachable code"),
);
let inner_to_struct = __stacklover_inner_to_struct_fn_unreachable;
inner_to_struct(created_value)
};
fn __stacklover_fn_param_unreachable<T, R>(_: impl Fn(T) -> R) -> T {
::core::panicking::panic("internal error: entered unreachable code")
}
__stacklover_fn_param_unreachable(__stacklover_inner_to_struct_fn_unreachable)
}
impl Iterator1 {
#[inline(always)]
pub fn new(dep1: &'static str, dep2: i32) -> __StackloverWrappedType<Self> {
let __stacklover_inner_to_struct_fn = |inner| Self {
__private_inner: unsafe {
::core::mem::transmute::<
_,
::stacklover::__private_mod::ErasedStorage<
{ Iterator1::__SIZE },
{ Iterator1::__ALIGN },
>,
>(inner)
},
};
{
let created_value = __stacklover_create(dep1, dep2);
let inner_to_struct = __stacklover_inner_to_struct_fn;
inner_to_struct(created_value)
}
}
}
const _: () = {
if !(::core::mem::size_of::<Iterator1>() == Iterator1::__SIZE) {
{
::core::panicking::panic_fmt(format_args!("invalid size"));
}
}
if !(::core::mem::align_of::<Iterator1>() == Iterator1::__ALIGN) {
{
::core::panicking::panic_fmt(format_args!("invalid align"));
}
}
};
const _: fn() = || {
fn assert_static<T: 'static>(_: T) {}
assert_static(__stacklover_inner_unreachable());
};
impl Iterator1 {
#[doc(hidden)]
const __SIZE: usize = {
const fn size_of_return_value<R>(
_: &(impl ::core::ops::Fn() -> R),
) -> usize {
::core::mem::size_of::<R>()
}
size_of_return_value(&__stacklover_inner_unreachable)
};
#[doc(hidden)]
const __ALIGN: usize = {
const fn align_of_return_value<R>(
_: &(impl ::core::ops::Fn() -> R),
) -> usize {
::core::mem::align_of::<R>()
}
align_of_return_value(&__stacklover_inner_unreachable)
};
#[inline(always)]
pub fn as_ref(&self) -> &(impl Iterator<Item = i32> + Clone) {
if true {
unsafe {
::core::mem::transmute::<
&::stacklover::__private_mod::ErasedStorage<
{ Iterator1::__SIZE },
{ Iterator1::__ALIGN },
>,
_,
>(&self.__private_inner)
}
} else {
fn ref_unreachable<S, T>(_self: &S, _: T) -> &T {
::core::panicking::panic("internal error: entered unreachable code")
}
#[allow(unreachable_code)]
ref_unreachable(self, __stacklover_inner_unreachable())
}
}
#[inline(always)]
pub fn as_mut(&mut self) -> &mut (impl Iterator<Item = i32> + Clone) {
if true {
unsafe {
::core::mem::transmute::<
&mut ::stacklover::__private_mod::ErasedStorage<
{ Iterator1::__SIZE },
{ Iterator1::__ALIGN },
>,
_,
>(&mut self.__private_inner)
}
} else {
fn mut_unreachable<S, T>(_self: &mut S, _: T) -> &mut T {
::core::panicking::panic("internal error: entered unreachable code")
}
#[allow(unreachable_code)]
mut_unreachable(self, __stacklover_inner_unreachable())
}
}
#[inline(always)]
pub fn into_inner(self) -> impl Iterator<Item = i32> + Clone {
if true {
unsafe { ::core::mem::transmute(self) }
} else {
#[allow(unreachable_code)] __stacklover_inner_unreachable()
}
}
#[inline(always)]
pub fn as_pin_mut(
self: ::core::pin::Pin<&mut Self>,
) -> ::core::pin::Pin<&mut (impl Iterator<Item = i32> + Clone)> {
unsafe { self.map_unchecked_mut(Self::as_mut) }
}
}
const _: fn() = || {
fn assert_trait<T: ::core::marker::Send>(_: T) {}
assert_trait(__stacklover_inner_unreachable());
};
unsafe impl ::core::marker::Send for Iterator1 {}
const _: fn() = || {
fn assert_trait<T: ::core::marker::Sync>(_: T) {}
assert_trait(__stacklover_inner_unreachable());
};
unsafe impl ::core::marker::Sync for Iterator1 {}
impl ::core::clone::Clone for Iterator1 {
fn clone(&self) -> Self {
let cloned = ::core::clone::Clone::clone(Iterator1::as_ref(self));
Self {
__private_inner: unsafe {
::core::mem::transmute::<
_,
::stacklover::__private_mod::ErasedStorage<
{ Iterator1::__SIZE },
{ Iterator1::__ALIGN },
>,
>(cloned)
},
}
}
}
impl ::core::ops::Drop for Iterator1 {
#[inline(always)]
fn drop(&mut self) {
unsafe { ::core::ptr::drop_in_place(self.as_mut()) }
}
}
};
fn main() {}