Exhaustively match on ty::Const::kind

This commit is contained in:
Oli Scherer 2023-08-29 15:11:51 +00:00
parent 9b8e3eb8f7
commit 3a736a747d

View File

@ -1095,7 +1095,18 @@ fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T {
} }
ty::ParamCt(param) => stable_mir::ty::ConstantKind::ParamCt(opaque(&param)), ty::ParamCt(param) => stable_mir::ty::ConstantKind::ParamCt(opaque(&param)),
ty::ErrorCt(_) => unreachable!(), ty::ErrorCt(_) => unreachable!(),
_ => unimplemented!(), ty::InferCt(_) => unreachable!(),
ty::BoundCt(_, _) => unimplemented!(),
ty::PlaceholderCt(_) => unimplemented!(),
ty::Unevaluated(uv) => {
stable_mir::ty::ConstantKind::Unevaluated(stable_mir::ty::UnevaluatedConst {
ty: tables.intern_ty(self.ty()),
def: tables.const_def(uv.def),
args: uv.args.stable(tables),
promoted: None,
})
}
ty::ExprCt(_) => unimplemented!(),
}, },
} }
} }