From c80281a861a0dd0760ea1b0a6230820ecabd7bef Mon Sep 17 00:00:00 2001 From: ouz-a Date: Thu, 10 Aug 2023 19:32:45 +0300 Subject: [PATCH] cover ParamConst --- compiler/rustc_smir/src/rustc_smir/mod.rs | 4 +++- compiler/rustc_smir/src/stable_mir/ty.rs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_smir/src/rustc_smir/mod.rs b/compiler/rustc_smir/src/rustc_smir/mod.rs index 07ef53ca30453..6d0f02f8f8104 100644 --- a/compiler/rustc_smir/src/rustc_smir/mod.rs +++ b/compiler/rustc_smir/src/rustc_smir/mod.rs @@ -1136,7 +1136,9 @@ impl<'tcx> Stable<'tcx> for rustc_middle::mir::ConstantKind<'tcx> { let const_val = tables.tcx.valtree_to_const_val((c.ty(), val)); stable_mir::ty::ConstantKind::Allocated(new_allocation(self, const_val, tables)) } - _ => todo!(), + ty::ParamCt(param) => stable_mir::ty::ConstantKind::ParamCt(opaque(¶m)), + ty::ErrorCt(_) => unreachable!(), + _ => unimplemented!(), }, ConstantKind::Unevaluated(unev_const, ty) => { stable_mir::ty::ConstantKind::Unevaluated(stable_mir::ty::UnevaluatedConst { diff --git a/compiler/rustc_smir/src/stable_mir/ty.rs b/compiler/rustc_smir/src/stable_mir/ty.rs index 14b841a467034..9b2bc97284514 100644 --- a/compiler/rustc_smir/src/stable_mir/ty.rs +++ b/compiler/rustc_smir/src/stable_mir/ty.rs @@ -401,6 +401,7 @@ pub fn allocation_filter<'tcx>( pub enum ConstantKind { Allocated(Allocation), Unevaluated(UnevaluatedConst), + ParamCt(Opaque), } #[derive(Clone, Debug)]