Examples of pairs of fields we can replace:
|
pub params: Vec<GenericParamDef>, |
|
|
|
/// Reverse map to the `index` field of each `GenericParamDef` |
|
#[stable_hasher(ignore)] |
|
pub param_def_id_to_index: FxHashMap<DefId, u32>, |
|
names: FxHashMap<&'static str, Symbol>, |
|
strings: Vec<&'static str>, |
|
spans: FxHashMap<SpanData, u32>, |
|
span_data: Vec<SpanData>, |
(any interner that relies on indices can be switched to
IndexSet, really)
We could also wrap Index{Set,Map}, like IndexedVec wraps Vec, to use non-usize indices.
(Or we could make our own that stores indices smaller than usize, not sure how much work that is, or if we want to do it at all, cc @bluss)
Examples of pairs of fields we can replace:
rust/src/librustc/ty/mod.rs
Lines 905 to 909 in c6ac575
rust/src/libsyntax_pos/symbol.rs
Lines 447 to 448 in c6ac575
rust/src/libsyntax_pos/span_encoding.rs
Lines 114 to 115 in c6ac575
(any interner that relies on indices can be switched to
IndexSet, really)We could also wrap
Index{Set,Map}, likeIndexedVecwrapsVec, to use non-usizeindices.(Or we could make our own that stores indices smaller than
usize, not sure how much work that is, or if we want to do it at all, cc @bluss)