1
Fork 0
rust/compiler/rustc_hir_analysis/src
Jacob Pratt dcf1134386
Rollup merge of #136270 - nnethercote:rm-NamedVarMap, r=jackh726
Remove `NamedVarMap`.

`NamedVarMap` is extremely similar to `ResolveBoundVars`. The former contains two `UnordMap<ItemLocalId, T>` fields (obscured behind `ItemLocalMap` typedefs). The latter contains two
`SortedMap<ItemLocalId, T>` fields. We construct a `NamedVarMap` and then convert it into a `ResolveBoundVars` by sorting the `UnordMap`s, which is unnecessary busywork.

This commit removes `NamedVarMap` and constructs a `ResolveBoundVars` directly. `SortedMap` and `NamedVarMap` have slightly different perf characteristics during construction (e.g. speed of insertion) but this code isn't hot enough for that to matter.

A few details to note.
- A `FIXME` comment is removed.
- The detailed comments on the fields of `NamedVarMap` are copied to `ResolveBoundVars` (which has a single, incorrect comment).
- `BoundVarContext::map` is renamed.
- `ResolveBoundVars` gets a derived `Default` impl.

r? `@jackh726`
2025-01-31 00:25:36 -05:00
..
check Auto merge of #136038 - compiler-errors:outlives, r=lcnr 2025-01-30 11:40:32 +00:00
coherence Consolidate OutlivesEnv construction with resolve_regions 2025-01-28 18:55:03 +00:00
collect Rollup merge of #136270 - nnethercote:rm-NamedVarMap, r=jackh726 2025-01-31 00:25:36 -05:00
errors Remove redundant to_ident_string calls 2025-01-27 01:23:34 +00:00
hir_ty_lowering Eliminate PatKind::Path 2025-01-29 15:45:13 +00:00
impl_wf_check Consolidate OutlivesEnv construction with resolve_regions 2025-01-28 18:55:03 +00:00
outlives Implement const effect predicate in new solver 2024-10-24 09:46:36 +00:00
variance Begin to implement type system layer of unsafe binders 2024-12-22 21:57:57 +00:00
autoderef.rs Rename structurally_normalize to structurally_normalize_ty 2025-01-22 07:04:53 +00:00
bounds.rs Merge HostPolarity and BoundConstness 2024-10-30 16:23:16 +00:00
check_unused.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
collect.rs Make item self/non-self bound naming less whack 2025-01-28 19:08:50 +00:00
constrained_generic_params.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
delegation.rs Effects cleanup 2024-10-26 10:19:07 +08:00
errors.rs Use identifiers in diagnostics more often 2025-01-27 01:23:34 +00:00
hir_wf_check.rs visit_x_unambig 2025-01-23 06:01:36 +00:00
impl_wf_check.rs Use identifiers in diagnostics more often 2025-01-27 01:23:34 +00:00
lib.rs use fmt::from_fn in more places, instead of using structs that impl formatting traits 2025-01-24 14:45:56 +00:00