pub struct EnvId(/* private fields */);Expand description
Identity of a hash-consed LOCAL TYPING ENVIRONMENT — the fragment of a Context that
decides a term’s type, and therefore half of the key an inferType cache must have.
A Term names its variables. Var("x") interns to ONE TermId whatever scope it is in,
and Context::extend SHADOWS, so the same id has type Nat under one context and Bool
under another. A cache keyed on the term alone would hand the second context the first’s
answer — the kernel certifying a type the term does not have. That is not a hazard Lean
shares: its Expr uses de Bruijn indices and globally-unique FVarIds, so two occurrences
in different scopes are literally different Exprs and inferType may cache on the
expression alone. Ours may not, and this is the missing half.
Implementations§
Trait Implementations§
Source§impl Ord for EnvId
impl Ord for EnvId
Source§impl PartialOrd for EnvId
impl PartialOrd for EnvId
impl Copy for EnvId
impl Eq for EnvId
impl StructuralPartialEq for EnvId
Auto Trait Implementations§
impl Freeze for EnvId
impl RefUnwindSafe for EnvId
impl Send for EnvId
impl Sync for EnvId
impl Unpin for EnvId
impl UnsafeUnpin for EnvId
impl UnwindSafe for EnvId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more