rust/compiler/rustc_middle/src/middle
Nicholas Nethercote 022c0ce947 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.
2025-01-30 09:39:52 +11:00
..
codegen_fn_attrs.rs Rename OptimizeAttr::None to Default 2025-01-24 19:34:01 +00:00
debugger_visualizer.rs fix clippy::clone_on_ref_ptr for compiler 2024-10-28 18:05:08 +03:00
dependency_format.rs Make DependencyList an IndexVec 2024-12-19 15:30:32 +00:00
exported_symbols.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
lang_items.rs Pretty print AsyncFn traits too 2024-11-22 16:55:28 +00:00
limits.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
mod.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
privacy.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
region.rs Rename Scope.id to Scope.local_id, remove trivial accessor 2024-12-19 02:31:58 +00:00
resolve_bound_vars.rs Remove NamedVarMap. 2025-01-30 09:39:52 +11:00
stability.rs Rollup merge of #135003 - RalfJung:deprecate-allowed-through-unstable, r=davidtwco 2025-01-15 16:30:11 +01:00