Skip to content

Commit 1bd8557

Browse files
committed
Also add a skip in MIR_borrow_checking
1 parent dd23814 commit 1bd8557

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

compiler/rustc_interface/src/passes.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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);

compiler/rustc_mir_transform/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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.
544544
fn 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
}

0 commit comments

Comments
 (0)