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<'_>) {
192
192
let _: R = tcx. ensure_ok ( ) . crate_inherent_impls_overlap_check ( ( ) ) ;
193
193
} ) ;
194
194
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.
197
195
tcx. par_hir_body_owners ( |item_def_id| {
198
196
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.
199
199
match def_kind {
200
200
DefKind :: Static { .. } => {
201
201
tcx. ensure_ok ( ) . eval_static_initializer ( item_def_id) ;
@@ -215,6 +215,11 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
215
215
if !matches ! ( def_kind, DefKind :: AnonConst ) {
216
216
tcx. ensure_ok ( ) . typeck ( item_def_id) ;
217
217
}
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
+ }
218
223
} ) ;
219
224
220
225
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<'_>) {
976
976
} ) ;
977
977
978
978
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
- } ) ;
986
979
// Freeze definitions as we don't add new ones at this point.
987
980
// We need to wait until now since we synthesize a by-move body
988
981
// for all coroutine-closures.
You can’t perform that action at this time.
0 commit comments