This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on idea: https://twitter.com/pkhuong/status/1287510400372748290 | |
use hashbrown::raw::RawTable; | |
pub struct ScopeMap<K, V> { | |
last_scope_id: ScopeId, | |
scopes: Vec<ScopeId>, // values are zeroed instead of popped to save a check in get() / is_fresh() | |
current_scope: ScopeDepth, // index of innermost valid scope | |
values: RawTable<Entry<K, V>>, | |
shadowed: Vec<Shadowed<K, V>>, |
OlderNewer