Skip to content

Commit d2a34c0

Browse files
committed
helper_crate overflow with nested async calls
1 parent e6993c0 commit d2a34c0

File tree

1 file changed

+211
-10
lines changed

1 file changed

+211
-10
lines changed

helper_crate/src/lib.rs

Lines changed: 211 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pub async fn entry_point() {
2-
let x = X9::new();
2+
let x = X24::new();
33
x.f().await;
44
}
55

@@ -21,7 +21,6 @@ impl X0 {
2121
term_sync() + term_async().await
2222
}
2323
}
24-
2524
struct X1 {
2625
x: X0,
2726
}
@@ -36,7 +35,6 @@ impl X1 {
3635
term_sync() + self.x.f().await
3736
}
3837
}
39-
4038
struct X2 {
4139
x: X1,
4240
}
@@ -51,7 +49,6 @@ impl X2 {
5149
term_sync() + self.x.f().await
5250
}
5351
}
54-
5552
struct X3 {
5653
x: X2,
5754
}
@@ -66,7 +63,6 @@ impl X3 {
6663
term_sync() + self.x.f().await
6764
}
6865
}
69-
7066
struct X4 {
7167
x: X3,
7268
}
@@ -81,7 +77,6 @@ impl X4 {
8177
term_sync() + self.x.f().await
8278
}
8379
}
84-
8580
struct X5 {
8681
x: X4,
8782
}
@@ -96,7 +91,6 @@ impl X5 {
9691
term_sync() + self.x.f().await
9792
}
9893
}
99-
10094
struct X6 {
10195
x: X5,
10296
}
@@ -111,7 +105,6 @@ impl X6 {
111105
term_sync() + self.x.f().await
112106
}
113107
}
114-
115108
struct X7 {
116109
x: X6,
117110
}
@@ -126,7 +119,6 @@ impl X7 {
126119
term_sync() + self.x.f().await
127120
}
128121
}
129-
130122
struct X8 {
131123
x: X7,
132124
}
@@ -141,7 +133,6 @@ impl X8 {
141133
term_sync() + self.x.f().await
142134
}
143135
}
144-
145136
struct X9 {
146137
x: X8,
147138
}
@@ -156,3 +147,213 @@ impl X9 {
156147
term_sync() + self.x.f().await
157148
}
158149
}
150+
struct X10 {
151+
x: X9,
152+
}
153+
impl X10 {
154+
fn new() -> Self {
155+
Self {
156+
x: X9::new(),
157+
}
158+
}
159+
160+
async fn f(&self) -> u32 {
161+
term_sync() + self.x.f().await
162+
}
163+
}
164+
struct X11 {
165+
x: X10,
166+
}
167+
impl X11 {
168+
fn new() -> Self {
169+
Self {
170+
x: X10::new(),
171+
}
172+
}
173+
174+
async fn f(&self) -> u32 {
175+
term_sync() + self.x.f().await
176+
}
177+
}
178+
struct X12 {
179+
x: X11,
180+
}
181+
impl X12 {
182+
fn new() -> Self {
183+
Self {
184+
x: X11::new(),
185+
}
186+
}
187+
188+
async fn f(&self) -> u32 {
189+
term_sync() + self.x.f().await
190+
}
191+
}
192+
struct X13 {
193+
x: X12,
194+
}
195+
impl X13 {
196+
fn new() -> Self {
197+
Self {
198+
x: X12::new(),
199+
}
200+
}
201+
202+
async fn f(&self) -> u32 {
203+
term_sync() + self.x.f().await
204+
}
205+
}
206+
struct X14 {
207+
x: X13,
208+
}
209+
impl X14 {
210+
fn new() -> Self {
211+
Self {
212+
x: X13::new(),
213+
}
214+
}
215+
216+
async fn f(&self) -> u32 {
217+
term_sync() + self.x.f().await
218+
}
219+
}
220+
struct X15 {
221+
x: X14,
222+
}
223+
impl X15 {
224+
fn new() -> Self {
225+
Self {
226+
x: X14::new(),
227+
}
228+
}
229+
230+
async fn f(&self) -> u32 {
231+
term_sync() + self.x.f().await
232+
}
233+
}
234+
struct X16 {
235+
x: X15,
236+
}
237+
impl X16 {
238+
fn new() -> Self {
239+
Self {
240+
x: X15::new(),
241+
}
242+
}
243+
244+
async fn f(&self) -> u32 {
245+
term_sync() + self.x.f().await
246+
}
247+
}
248+
struct X17 {
249+
x: X16,
250+
}
251+
impl X17 {
252+
fn new() -> Self {
253+
Self {
254+
x: X16::new(),
255+
}
256+
}
257+
258+
async fn f(&self) -> u32 {
259+
term_sync() + self.x.f().await
260+
}
261+
}
262+
struct X18 {
263+
x: X17,
264+
}
265+
impl X18 {
266+
fn new() -> Self {
267+
Self {
268+
x: X17::new(),
269+
}
270+
}
271+
272+
async fn f(&self) -> u32 {
273+
term_sync() + self.x.f().await
274+
}
275+
}
276+
struct X19 {
277+
x: X18,
278+
}
279+
impl X19 {
280+
fn new() -> Self {
281+
Self {
282+
x: X18::new(),
283+
}
284+
}
285+
286+
async fn f(&self) -> u32 {
287+
term_sync() + self.x.f().await
288+
}
289+
}
290+
struct X20 {
291+
x: X19,
292+
}
293+
impl X20 {
294+
fn new() -> Self {
295+
Self {
296+
x: X19::new(),
297+
}
298+
}
299+
300+
async fn f(&self) -> u32 {
301+
term_sync() + self.x.f().await
302+
}
303+
}
304+
struct X21 {
305+
x: X20,
306+
}
307+
impl X21 {
308+
fn new() -> Self {
309+
Self {
310+
x: X20::new(),
311+
}
312+
}
313+
314+
async fn f(&self) -> u32 {
315+
term_sync() + self.x.f().await
316+
}
317+
}
318+
struct X22 {
319+
x: X21,
320+
}
321+
impl X22 {
322+
fn new() -> Self {
323+
Self {
324+
x: X21::new(),
325+
}
326+
}
327+
328+
async fn f(&self) -> u32 {
329+
term_sync() + self.x.f().await
330+
}
331+
}
332+
struct X23 {
333+
x: X22,
334+
}
335+
impl X23 {
336+
fn new() -> Self {
337+
Self {
338+
x: X22::new(),
339+
}
340+
}
341+
342+
async fn f(&self) -> u32 {
343+
term_sync() + self.x.f().await
344+
}
345+
}
346+
struct X24 {
347+
x: X23,
348+
}
349+
impl X24 {
350+
fn new() -> Self {
351+
Self {
352+
x: X23::new(),
353+
}
354+
}
355+
356+
async fn f(&self) -> u32 {
357+
term_sync() + self.x.f().await
358+
}
359+
}

0 commit comments

Comments
 (0)