1
Fork 0

found another place where we can eval() a const, and go through valtrees

This commit is contained in:
Ralf Jung 2023-09-14 07:53:38 +02:00
parent 292d5bba86
commit 19fb2c7ccd
3 changed files with 14 additions and 39 deletions

View file

@ -2297,7 +2297,11 @@ pub struct Constant<'tcx> {
#[derive(Clone, Copy, PartialEq, Eq, TyEncodable, TyDecodable, Hash, HashStable, Debug)]
#[derive(Lift, TypeFoldable, TypeVisitable)]
pub enum ConstantKind<'tcx> {
/// This constant came from the type system
/// This constant came from the type system.
///
/// Any way of turning `ty::Const` into `ConstValue` should go through `valtree_to_const_val`;
/// this ensures that we consistently produce "clean" values without data in the padding or
/// anything like that.
Ty(ty::Const<'tcx>),
/// An unevaluated mir constant which is not part of the type system.