Skip to content

Commit 1d0792b

Browse files
authored
Rollup merge of #114703 - ouz-a:smir_allocation, r=oli-obk
Cover ParamConst in smir Others variants won't be useful for a while or ever(?), but we might need this one. r? ````@oli-obk````
2 parents 70cd8d5 + c80281a commit 1d0792b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

compiler/rustc_smir/src/rustc_smir/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,9 @@ impl<'tcx> Stable<'tcx> for rustc_middle::mir::ConstantKind<'tcx> {
11651165
let const_val = tables.tcx.valtree_to_const_val((c.ty(), val));
11661166
stable_mir::ty::ConstantKind::Allocated(new_allocation(self, const_val, tables))
11671167
}
1168-
_ => todo!(),
1168+
ty::ParamCt(param) => stable_mir::ty::ConstantKind::ParamCt(opaque(&param)),
1169+
ty::ErrorCt(_) => unreachable!(),
1170+
_ => unimplemented!(),
11691171
},
11701172
ConstantKind::Unevaluated(unev_const, ty) => {
11711173
stable_mir::ty::ConstantKind::Unevaluated(stable_mir::ty::UnevaluatedConst {

compiler/rustc_smir/src/stable_mir/ty.rs

+1
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ pub fn allocation_filter<'tcx>(
417417
pub enum ConstantKind {
418418
Allocated(Allocation),
419419
Unevaluated(UnevaluatedConst),
420+
ParamCt(Opaque),
420421
}
421422

422423
#[derive(Clone, Debug)]

0 commit comments

Comments
 (0)