1
Fork 0

Add Ty to ConstKind::Value

This commit is contained in:
Boxy 2024-06-03 02:34:35 +01:00
parent 58feec9b85
commit a9702a6668
30 changed files with 180 additions and 186 deletions

View file

@ -23,7 +23,7 @@ fn destructure_const<'tcx>(
tcx: TyCtxt<'tcx>,
const_: ty::Const<'tcx>,
) -> ty::DestructuredConst<'tcx> {
let ty::ConstKind::Value(valtree) = const_.kind() else {
let ty::ConstKind::Value(ct_ty, valtree) = const_.kind() else {
bug!("cannot destructure constant {:?}", const_)
};
@ -32,9 +32,6 @@ fn destructure_const<'tcx>(
_ => bug!("cannot destructure constant {:?}", const_),
};
// THISPR
let ct_ty: Ty<'tcx> = todo!();
let (fields, variant) = match ct_ty.kind() {
ty::Array(inner_ty, _) | ty::Slice(inner_ty) => {
// construct the consts for the elements of the array/slice