rust/compiler/rustc_metadata/src
Nicholas Nethercote 661f99ba03 Overhaul the intravisit::Map trait.
First of all, note that `Map` has three different relevant meanings.
- The `intravisit::Map` trait.
- The `map::Map` struct.
- The `NestedFilter::Map` associated type.

The `intravisit::Map` trait is impl'd twice.
- For `!`, where the methods are all unreachable.
- For `map::Map`, which gets HIR stuff from the `TyCtxt`.

As part of getting rid of `map::Map`, this commit changes `impl
intravisit::Map for map::Map` to `impl intravisit::Map for TyCtxt`. It's
fairly straightforward except various things are renamed, because the
existing names would no longer have made sense.

- `trait intravisit::Map` becomes `trait intravisit::HirTyCtxt`, so named
  because it gets some HIR stuff from a `TyCtxt`.
- `NestedFilter::Map` assoc type becomes `NestedFilter::MaybeTyCtxt`,
  because it's always `!` or `TyCtxt`.
- `Visitor::nested_visit_map` becomes `Visitor::maybe_tcx`.

I deliberately made the new trait and associated type names different to
avoid the old `type Map: Map` situation, which I found confusing. We now
have `type MaybeTyCtxt: HirTyCtxt`.
2025-02-17 13:21:35 +11:00
..
rmeta Overhaul the intravisit::Map trait. 2025-02-17 13:21:35 +11:00
creader.rs Rustfmt 2025-02-08 22:12:13 +00:00
dependency_format.rs Review comments 2024-12-20 08:35:02 +00:00
errors.rs Target modifiers (special marked options) are recorded in metainfo and compared to be equal in different crates 2025-02-02 22:12:49 +07:00
foreign_modules.rs Move some Map methods onto TyCtxt. 2025-02-17 13:21:02 +11:00
fs.rs Dogfood feature(file_buffered) 2024-09-24 14:25:16 -07:00
lib.rs Rollup merge of #130518 - scottmcm:stabilize-controlflow-extra, r=dtolnay 2024-10-04 14:11:34 -07:00
locator.rs rustc_metadata: Rename root to dep_root 2025-01-14 08:51:19 +00:00
native_libs.rs Auto merge of #134243 - nnethercote:re-export-more-rustc_span, r=jieyouxu 2024-12-18 02:56:38 +00:00