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 @@ -194,10 +194,10 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
194
194
let _: R = tcx. ensure_ok ( ) . crate_inherent_impls_overlap_check ( ( ) ) ;
195
195
} ) ;
196
196
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.
199
197
tcx. par_hir_body_owners ( |item_def_id| {
200
198
let def_kind = tcx. def_kind ( item_def_id) ;
199
+ // Make sure we evaluate all static and (non-associated) const items, even if unused.
200
+ // If any of these fail to evaluate, we do not want this crate to pass compilation.
201
201
match def_kind {
202
202
DefKind :: Static { .. } => {
203
203
tcx. ensure_ok ( ) . eval_static_initializer ( item_def_id) ;
@@ -217,6 +217,11 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
217
217
if !matches ! ( def_kind, DefKind :: AnonConst ) {
218
218
tcx. ensure_ok ( ) . typeck ( item_def_id) ;
219
219
}
220
+ // Ensure we generate the new `DefId` before finishing `check_crate`.
221
+ // Afterwards we freeze the list of `DefId`s.
222
+ if tcx. needs_coroutine_by_move_body_def_id ( item_def_id. to_def_id ( ) ) {
223
+ tcx. ensure_done ( ) . coroutine_by_move_body_def_id ( item_def_id) ;
224
+ }
220
225
} ) ;
221
226
222
227
if tcx. features ( ) . rustc_attrs ( ) {
Original file line number Diff line number Diff line change @@ -981,13 +981,6 @@ fn run_required_analyses(tcx: TyCtxt<'_>) {
981
981
} ) ;
982
982
983
983
rustc_hir_analysis:: check_crate ( tcx) ;
984
- sess. time ( "MIR_coroutine_by_move_body" , || {
985
- tcx. par_hir_body_owners ( |def_id| {
986
- if tcx. needs_coroutine_by_move_body_def_id ( def_id. to_def_id ( ) ) {
987
- tcx. ensure_done ( ) . coroutine_by_move_body_def_id ( def_id) ;
988
- }
989
- } ) ;
990
- } ) ;
991
984
// Freeze definitions as we don't add new ones at this point.
992
985
// We need to wait until now since we synthesize a by-move body
993
986
// for all coroutine-closures.
You can’t perform that action at this time.
0 commit comments