File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -192,10 +192,10 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
192192 let _: R = tcx. ensure_ok ( ) . crate_inherent_impls_overlap_check ( ( ) ) ;
193193 } ) ;
194194
195- // Make sure we evaluate all static and (non-associated) const items, even if unused.
196- // If any of these fail to evaluate, we do not want this crate to pass compilation.
197195 tcx. par_hir_body_owners ( |item_def_id| {
198196 let def_kind = tcx. def_kind ( item_def_id) ;
197+ // Make sure we evaluate all static and (non-associated) const items, even if unused.
198+ // If any of these fail to evaluate, we do not want this crate to pass compilation.
199199 match def_kind {
200200 DefKind :: Static { .. } => {
201201 tcx. ensure_ok ( ) . eval_static_initializer ( item_def_id) ;
@@ -215,6 +215,11 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
215215 if !matches ! ( def_kind, DefKind :: AnonConst ) {
216216 tcx. ensure_ok ( ) . typeck ( item_def_id) ;
217217 }
218+ // Ensure we generate the new `DefId` before finishing `check_crate`.
219+ // Afterwards we freeze the list of `DefId`s.
220+ if tcx. needs_coroutine_by_move_body_def_id ( item_def_id. to_def_id ( ) ) {
221+ tcx. ensure_done ( ) . coroutine_by_move_body_def_id ( item_def_id) ;
222+ }
218223 } ) ;
219224
220225 if tcx. features ( ) . rustc_attrs ( ) {
Original file line number Diff line number Diff line change @@ -976,13 +976,6 @@ fn run_required_analyses(tcx: TyCtxt<'_>) {
976976 } ) ;
977977
978978 rustc_hir_analysis:: check_crate ( tcx) ;
979- sess. time ( "MIR_coroutine_by_move_body" , || {
980- tcx. par_hir_body_owners ( |def_id| {
981- if tcx. needs_coroutine_by_move_body_def_id ( def_id. to_def_id ( ) ) {
982- tcx. ensure_done ( ) . coroutine_by_move_body_def_id ( def_id) ;
983- }
984- } ) ;
985- } ) ;
986979 // Freeze definitions as we don't add new ones at this point.
987980 // We need to wait until now since we synthesize a by-move body
988981 // for all coroutine-closures.
You can’t perform that action at this time.
0 commit comments