File tree 2 files changed +28
-0
lines changed
src/test/run-pass/async-await
2 files changed +28
-0
lines changed File renamed without changes.
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments