Skip to content

Commit

Permalink
comment on the difference between mir::ConstantKind::Unevaluated and …
Browse files Browse the repository at this point in the history
…mir::ConstantKind::Ty(ty::ConstKind::Unevaluated)
  • Loading branch information
RalfJung committed Sep 19, 2023
1 parent 5a0a1ff commit d14e601
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/rustc_middle/src/mir/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d14e601

Please sign in to comment.