File tree 2 files changed +20
-0
lines changed
compiler/rustc_mir_transform/src
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,12 @@ impl<'tcx> MirPass<'tcx> for JumpThreading {
68
68
let def_id = body. source . def_id ( ) ;
69
69
debug ! ( ?def_id) ;
70
70
71
+ // Optimizing coroutines creates query cycles.
72
+ if tcx. is_coroutine ( def_id) {
73
+ trace ! ( "Skipped for coroutine {:?}" , def_id) ;
74
+ return ;
75
+ }
76
+
71
77
let param_env = tcx. param_env_reveal_all_normalized ( def_id) ;
72
78
let map = Map :: new ( tcx, body, Some ( MAX_PLACES ) ) ;
73
79
let loop_headers = loop_headers ( body) ;
Original file line number Diff line number Diff line change
1
+ // Regression test for #121094.
2
+ // build-pass
3
+ // compile-flags: -O --crate-type=lib
4
+ // edition: 2021
5
+ use std:: { future:: Future , pin:: Pin } ;
6
+
7
+ pub async fn foo ( count : u32 ) {
8
+ if count == 0 {
9
+ return
10
+ } else {
11
+ let fut: Pin < Box < dyn Future < Output = ( ) > > > = Box :: pin ( foo ( count - 1 ) ) ;
12
+ fut. await ;
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments