1
Fork 0

Don't call closure_by_move_body_def_id on FnOnce async closures in MIR validation

This commit is contained in:
Michael Goulet 2024-09-10 10:54:59 -04:00
parent f827364a95
commit 5cf117ed05
5 changed files with 24 additions and 8 deletions

View file

@ -788,7 +788,7 @@ fn run_required_analyses(tcx: TyCtxt<'_>) {
rustc_hir_analysis::check_crate(tcx);
sess.time("MIR_coroutine_by_move_body", || {
tcx.hir().par_body_owners(|def_id| {
if tcx.needs_coroutine_by_move_body_def_id(def_id) {
if tcx.needs_coroutine_by_move_body_def_id(def_id.to_def_id()) {
tcx.ensure_with_value().coroutine_by_move_body_def_id(def_id);
}
});