about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-03-31 20:46:48 +0000
committerMichael Goulet <michael@errs.io>2025-03-31 21:10:56 +0000
commite2d5033bce2085fb2baaf5e887d11959928def74 (patch)
tree0284bfc4b49f6d6a5b5ddbde56b6a0e603a2c2d0 /compiler/rustc_mir_transform
parent0b45675cfcec57f30a3794e1a1e18423aa9cf200 (diff)
Feed HIR for by-move coroutine body def, since the inliner tries to read its attrs
Diffstat (limited to 'compiler/rustc_mir_transform')
-rw-r--r--compiler/rustc_mir_transform/src/coroutine/by_move_body.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs b/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs
index 89a306c6104..dd0e07f2218 100644
--- a/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs
+++ b/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs
@@ -219,6 +219,8 @@ pub(crate) fn coroutine_by_move_body_def_id<'tcx>(
         mir::MirSource::from_instance(InstanceKind::Item(body_def.def_id().to_def_id()));
     dump_mir(tcx, false, "built", &"after", &by_move_body, |_, _| Ok(()));
 
+    // Feed HIR because we try to access this body's attrs in the inliner.
+    body_def.feed_hir();
     // Inherited from the by-ref coroutine.
     body_def.codegen_fn_attrs(tcx.codegen_fn_attrs(coroutine_def_id).clone());
     body_def.coverage_attr_on(tcx.coverage_attr_on(coroutine_def_id));