Skip to content

Commit 2010e0a

Browse files
committed
Encode const constructor MIR in crate metadata
Tuple/struct constructors were already recorded, and we need the const constructor MIR for the new const-path lowering.
1 parent 8d3bd55 commit 2010e0a

File tree

1 file changed

+2
-2
lines changed
  • compiler/rustc_mir_transform/src

1 file changed

+2
-2
lines changed

compiler/rustc_mir_transform/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use rustc_const_eval::util;
2121
use rustc_data_structures::fx::FxIndexSet;
2222
use rustc_data_structures::steal::Steal;
2323
use rustc_hir as hir;
24-
use rustc_hir::def::{CtorKind, DefKind};
24+
use rustc_hir::def::DefKind;
2525
use rustc_hir::def_id::LocalDefId;
2626
use rustc_index::IndexVec;
2727
use rustc_middle::mir::{
@@ -322,7 +322,7 @@ fn mir_keys(tcx: TyCtxt<'_>, (): ()) -> FxIndexSet<LocalDefId> {
322322
for item in tcx.hir_crate_items(()).free_items() {
323323
if let DefKind::Struct | DefKind::Enum = tcx.def_kind(item.owner_id) {
324324
for variant in tcx.adt_def(item.owner_id).variants() {
325-
if let Some((CtorKind::Fn, ctor_def_id)) = variant.ctor {
325+
if let Some((_, ctor_def_id)) = variant.ctor {
326326
set.insert(ctor_def_id.expect_local());
327327
}
328328
}

0 commit comments

Comments
 (0)