File tree Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Original file line number Diff line number Diff line change 22// edition:2018
33
44// This test is derived from
5- // https://github.com/rust-lang/rust/issues/74961#issuecomment-666893845
6- // by @SNCPlay42
5+ // https://github.com/rust-lang/rust/issues/72651#issuecomment-668720468
76
87// This test demonstrates that, in `async fn g()`,
98// indeed a temporary borrow `y` from `x` is live
109// while `f().await` is being evaluated.
11- // Thus, `&'_ A ` should be included in type signature
10+ // Thus, `&'_ u8 ` should be included in type signature
1211// of the underlying generator.
1312
14- #[ derive( PartialEq , Eq ) ]
15- struct A ;
13+ async fn f ( ) -> u8 { 1 }
1614
17- async fn f ( ) -> A {
18- A
19- }
20-
21- async fn g ( ) {
22- let x = A ;
15+ pub async fn g ( x : u8 ) {
2316 match x {
24- y if f ( ) . await == y => { }
25- _ => { }
17+ y if f ( ) . await == y => ( ) ,
18+ _ => ( ) ,
2619 }
2720}
2821
29- fn main ( ) { }
22+ fn main ( ) {
23+ let _ = g ( 10 ) ;
24+ }
You can’t perform that action at this time.
0 commit comments