Skip to content

Commit 3180434

Browse files
committed
fix(query): Rotate parallel cycle entries to match recovery target
1 parent 2c756e8 commit 3180434

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

compiler/rustc_query_impl/src/execution.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,16 @@ fn wait_for_query<'tcx, C: QueryCache>(
270270

271271
(v, Some(index))
272272
}
273-
Err(cycle) => (mk_cycle(query, tcx, cycle.lift()), None),
273+
Err(mut cycle) => {
274+
if let Some(def_id) = key.key_as_def_id() {
275+
if let Some(pos) = cycle.cycle.iter().position(|entry| {
276+
entry.frame.dep_kind == query.dep_kind && entry.frame.def_id == Some(def_id)
277+
}) {
278+
cycle.cycle.rotate_left(pos);
279+
}
280+
}
281+
(mk_cycle(query, tcx, cycle.lift()), None)
282+
}
274283
}
275284
}
276285

0 commit comments

Comments
 (0)