-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Examples of pairs of fields we can replace:
Lines 905 to 909 in c6ac575
| 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>, |
rust/src/libsyntax_pos/symbol.rs
Lines 447 to 448 in c6ac575
| names: FxHashMap<&'static str, Symbol>, | |
| strings: Vec<&'static str>, |
rust/src/libsyntax_pos/span_encoding.rs
Lines 114 to 115 in c6ac575
| 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)
Metadata
Metadata
Assignees
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.