Rollup merge of #130199 - compiler-errors:by-move, r=cjgillot
Don't call closure_by_move_body_def_id on FnOnce async closures in MIR validation Refactors the check in #129847 to not unncessarily call the `closure_by_move_body_def_id` query for async closures that don't *need* a by-move body. Fixes #130167
This commit is contained in:
commit
04e744e77d
5 changed files with 24 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue