Skip to content

Commit

Permalink
Rollup merge of rust-lang#114703 - ouz-a:smir_allocation, r=oli-obk
Browse files Browse the repository at this point in the history
Cover ParamConst in smir

Others variants won't be useful for a while or ever(?), but we might need this one.

r? `@oli-obk`
  • Loading branch information
matthiaskrgr authored Aug 11, 2023
2 parents 979cc54 + c80281a commit 3341ce9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_smir/src/rustc_smir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_smir/src/stable_mir/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ pub fn allocation_filter<'tcx>(
pub enum ConstantKind {
Allocated(Allocation),
Unevaluated(UnevaluatedConst),
ParamCt(Opaque),
}

#[derive(Clone, Debug)]
Expand Down

0 comments on commit 3341ce9

Please sign in to comment.