Skip to content

Commit

Permalink
explain a good reason for why LocalValue does not store the type of t…
Browse files Browse the repository at this point in the history
…he local
  • Loading branch information
RalfJung committed Nov 30, 2023
1 parent df0295f commit a1b03e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_const_eval/src/interpret/eval_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ impl<Prov: Provenance> std::fmt::Debug for LocalState<'_, Prov> {
}

/// Current value of a local variable
///
/// This does not store the type of the local; the type is given by `body.local_decls` and can never
/// change, so by not storing here we avoid having to maintain that as an invariant.
#[derive(Copy, Clone, Debug)] // Miri debug-prints these
pub(super) enum LocalValue<Prov: Provenance = AllocId> {
/// This local is not currently alive, and cannot be used at all.
Expand Down

0 comments on commit a1b03e3

Please sign in to comment.