File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1088,6 +1088,9 @@ fn run_required_analyses(tcx: TyCtxt<'_>) {
10881088
10891089 sess. time ( "MIR_borrow_checking" , || {
10901090 tcx. par_hir_body_owners ( |def_id| {
1091+ if tcx. is_trivial_const ( def_id) . is_some ( ) {
1092+ return ;
1093+ }
10911094 if !tcx. is_typeck_child ( def_id. to_def_id ( ) ) {
10921095 // Child unsafety and borrowck happens together with the parent
10931096 tcx. ensure_ok ( ) . check_unsafety ( def_id) ;
Original file line number Diff line number Diff line change @@ -542,6 +542,9 @@ fn inner_mir_for_ctfe(tcx: TyCtxt<'_>, def: LocalDefId) -> Body<'_> {
542542/// mir borrowck *before* doing so in order to ensure that borrowck can be run and doesn't
543543/// end up missing the source MIR due to stealing happening.
544544fn mir_drops_elaborated_and_const_checked ( tcx : TyCtxt < ' _ > , def : LocalDefId ) -> & Steal < Body < ' _ > > {
545+ if tcx. is_trivial_const ( def) . is_some ( ) {
546+ panic ! ( "Tried to get mir_for_ctfe of a trivial const" ) ;
547+ }
545548 if tcx. is_coroutine ( def. to_def_id ( ) ) {
546549 tcx. ensure_done ( ) . mir_coroutine_witnesses ( def) ;
547550 }
You can’t perform that action at this time.
0 commit comments