about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2024-09-14 11:53:12 +1000
committerGitHub <noreply@github.com>2024-09-14 11:53:12 +1000
commit04e744e77d1389a366aa4c9477abf026eb360411 (patch)
tree251e695e2b7dfc2a8dd415d1c10478f6581cd484 /compiler/rustc_interface/src
parent2bf0dd2735d0165a95036594f5f900a12217f6a0 (diff)
parent5cf117ed0514af068a6e0e42f732dd93ff5e90dc (diff)
downloadrust-04e744e77d1389a366aa4c9477abf026eb360411.tar.gz
rust-04e744e77d1389a366aa4c9477abf026eb360411.zip
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
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/passes.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index c4a38047b5e..b93bc3ed84f 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -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);
             }
         });