We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 433a467 commit 65021ecCopy full SHA for 65021ec
src/test/run-pass/async-await/issue-60709.rs
@@ -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