Move methods from Map to TyCtxt, part 4.

Continuing the work from #137350.

Removes the unused methods: `expect_variant`, `expect_field`,
`expect_foreign_item`.

Every method gains a `hir_` prefix.
This commit is contained in:
Nicholas Nethercote
2025-02-21 18:33:05 +11:00
parent 281af35cc3
commit 256c27e748
115 changed files with 269 additions and 321 deletions

View File

@@ -268,8 +268,7 @@ pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) {
let tcx = ex.tcx();
let f = |annotation: &dyn pprust_hir::PpAnn| {
let sm = sess.source_map();
let hir_map = tcx.hir();
let attrs = |id| hir_map.attrs(id);
let attrs = |id| tcx.hir_attrs(id);
pprust_hir::print_crate(
sm,
tcx.hir_root_module(),