comment on the difference between mir::ConstantKind::Unevaluated and mir::ConstantKind::Ty(ty::ConstKind::Unevaluated)

This commit is contained in:
Ralf Jung 2023-09-16 09:41:46 +02:00
parent 5a0a1ff0cd
commit d14e601661

View File

@ -200,6 +200,11 @@ pub enum ConstantKind<'tcx> {
Ty(ty::Const<'tcx>),
/// An unevaluated mir constant which is not part of the type system.
///
/// Note that `Ty(ty::ConstKind::Unevaluated)` and this variant are *not* identical! `Ty` will
/// always flow through a valtree, so all data not captured in the valtree is lost. This variant
/// directly uses the evaluated result of the given constant, including e.g. data stored in
/// padding.
Unevaluated(UnevaluatedConst<'tcx>, Ty<'tcx>),
/// This constant cannot go back into the type system, as it represents