Skip to content

Commit 2238a94

Browse files
authored
Rollup merge of rust-lang#61818 - tmandry:issue-60709-test, r=cramertj
Issue rust-lang#60709 test Adds a test for rust-lang#60709, which was fixed as part of rust-lang#59897. r? @cramertj
2 parents 0721364 + b7397cc commit 2238a94

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

src/test/run-pass/async-fn-size.rs renamed to src/test/run-pass/async-await/async-fn-size.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// edition:2018
2-
// aux-build:arc_wake.rs
32

43
#![feature(async_await, await_macro)]
54

6-
extern crate arc_wake;
5+
#[path = "../auxiliary/arc_wake.rs"]
6+
mod arc_wake;
77

88
use std::pin::Pin;
99
use std::future::Future;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// This used to compile the future down to ud2, due to uninhabited types being
2+
// handled incorrectly in generators.
3+
// compile-flags: -Copt-level=z -Cdebuginfo=2 --edition=2018
4+
5+
#![feature(async_await, await_macro)]
6+
#![allow(unused)]
7+
8+
use std::future::Future;
9+
use std::task::Poll;
10+
use std::task::Context;
11+
use std::pin::Pin;
12+
use std::rc::Rc;
13+
14+
struct Never();
15+
impl Future for Never {
16+
type Output = ();
17+
fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Self::Output> {
18+
Poll::Pending
19+
}
20+
}
21+
22+
fn main() {
23+
let fut = async {
24+
let _rc = Rc::new(()); // Also crashes with Arc
25+
await!(Never());
26+
};
27+
let _bla = fut; // Moving the future is required.
28+
}

0 commit comments

Comments
 (0)