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````
This commit is contained in:
Matthias Krüger 2023-08-12 12:06:37 +02:00 committed by GitHub
commit 1d0792bd80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -1165,7 +1165,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(&param)),
ty::ErrorCt(_) => unreachable!(),
_ => unimplemented!(),
},
ConstantKind::Unevaluated(unev_const, ty) => {
stable_mir::ty::ConstantKind::Unevaluated(stable_mir::ty::UnevaluatedConst {

View File

@ -417,6 +417,7 @@ pub fn allocation_filter<'tcx>(
pub enum ConstantKind {
Allocated(Allocation),
Unevaluated(UnevaluatedConst),
ParamCt(Opaque),
}
#[derive(Clone, Debug)]