File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -996,10 +996,9 @@ fn run_required_analyses(tcx: TyCtxt<'_>) {
996996
997997 sess. time ( "MIR_borrow_checking" , || {
998998 tcx. par_hir_body_owners ( |def_id| {
999- // Run unsafety check because it's responsible for stealing and
1000- // deallocating THIR.
1001- tcx. ensure_ok ( ) . check_unsafety ( def_id) ;
1002999 if !tcx. is_typeck_child ( def_id. to_def_id ( ) ) {
1000+ // Child unsafety and borrowck happens together with the parent
1001+ tcx. ensure_ok ( ) . check_unsafety ( def_id) ;
10031002 tcx. ensure_ok ( ) . mir_borrowck ( def_id)
10041003 }
10051004 } ) ;
Original file line number Diff line number Diff line change @@ -1148,8 +1148,9 @@ impl UnsafeOpKind {
11481148
11491149pub ( crate ) fn check_unsafety ( tcx : TyCtxt < ' _ > , def : LocalDefId ) {
11501150 // Closures and inline consts are handled by their owner, if it has a body
1151+ assert ! ( !tcx. is_typeck_child( def. to_def_id( ) ) ) ;
11511152 // Also, don't safety check custom MIR
1152- if tcx. is_typeck_child ( def . to_def_id ( ) ) || tcx . has_attr ( def, sym:: custom_mir) {
1153+ if tcx. has_attr ( def, sym:: custom_mir) {
11531154 return ;
11541155 }
11551156
You can’t perform that action at this time.
0 commit comments