File tree 2 files changed +4
-4
lines changed
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<'_>) {
996
996
997
997
sess. time ( "MIR_borrow_checking" , || {
998
998
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) ;
1002
999
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) ;
1003
1002
tcx. ensure_ok ( ) . mir_borrowck ( def_id)
1004
1003
}
1005
1004
} ) ;
Original file line number Diff line number Diff line change @@ -1148,8 +1148,9 @@ impl UnsafeOpKind {
1148
1148
1149
1149
pub ( crate ) fn check_unsafety ( tcx : TyCtxt < ' _ > , def : LocalDefId ) {
1150
1150
// Closures and inline consts are handled by their owner, if it has a body
1151
+ assert ! ( !tcx. is_typeck_child( def. to_def_id( ) ) ) ;
1151
1152
// 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) {
1153
1154
return ;
1154
1155
}
1155
1156
You can’t perform that action at this time.
0 commit comments