Skip to content

Commit 06ae3b7

Browse files
committed
Move some Map methods onto TyCtxt.
The end goal is to eliminate `Map` altogether. I added a `hir_` prefix to all of them, that seemed simplest. The exception is `module_items` which became `hir_module_free_items` because there was already a `hir_module_items`.
1 parent d505699 commit 06ae3b7

File tree

193 files changed

+455
-466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+455
-466
lines changed

compiler/rustc_ast_lowering/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ fn compute_hir_hash(
402402
.iter_enumerated()
403403
.filter_map(|(def_id, info)| {
404404
let info = info.as_owner()?;
405-
let def_path_hash = tcx.hir().def_path_hash(def_id);
405+
let def_path_hash = tcx.hir_def_path_hash(def_id);
406406
Some((def_path_hash, info))
407407
})
408408
.collect();
@@ -492,7 +492,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
492492
"adding a def'n for node-id {:?} and def kind {:?} but a previous def'n exists: {:?}",
493493
node_id,
494494
def_kind,
495-
self.tcx.hir().def_key(self.local_def_id(node_id)),
495+
self.tcx.hir_def_key(self.local_def_id(node_id)),
496496
);
497497

498498
let def_id = self.tcx.at(span).create_def(parent, name, def_kind).def_id();

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
14431443
let Some(hir_generics) = tcx
14441444
.typeck_root_def_id(self.mir_def_id().to_def_id())
14451445
.as_local()
1446-
.and_then(|def_id| tcx.hir().get_generics(def_id))
1446+
.and_then(|def_id| tcx.hir_get_generics(def_id))
14471447
else {
14481448
return;
14491449
};
@@ -2112,7 +2112,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
21122112
let tcx = self.infcx.tcx;
21132113
let body_id = tcx.hir_node(self.mir_hir_id()).body_id()?;
21142114
let mut expr_finder = FindExprBySpan::new(span, tcx);
2115-
expr_finder.visit_expr(tcx.hir().body(body_id).value);
2115+
expr_finder.visit_expr(tcx.hir_body(body_id).value);
21162116
expr_finder.result
21172117
}
21182118

@@ -3205,7 +3205,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
32053205
if let Some(scope) = self.body.source_scopes.get(source_info.scope)
32063206
&& let ClearCrossCrate::Set(scope_data) = &scope.local_data
32073207
&& let Some(id) = self.infcx.tcx.hir_node(scope_data.lint_root).body_id()
3208-
&& let hir::ExprKind::Block(block, _) = self.infcx.tcx.hir().body(id).value.kind
3208+
&& let hir::ExprKind::Block(block, _) = self.infcx.tcx.hir_body(id).value.kind
32093209
{
32103210
for stmt in block.stmts {
32113211
let mut visitor = NestedStatementVisitor {

compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ impl<'tcx> BorrowExplanation<'tcx> {
7575

7676
if let Some(span) = borrow_span {
7777
let def_id = body.source.def_id();
78-
if let Some(node) = tcx.hir().get_if_local(def_id)
78+
if let Some(node) = tcx.hir_get_if_local(def_id)
7979
&& let Some(body_id) = node.body_id()
8080
{
81-
let body = tcx.hir().body(body_id);
81+
let body = tcx.hir_body(body_id);
8282
let mut expr_finder = FindExprBySpan::new(span, tcx);
8383
expr_finder.visit_expr(body.value);
8484
if let Some(mut expr) = expr_finder.result {

compiler/rustc_borrowck/src/diagnostics/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
12191219
.tcx
12201220
.typeck_root_def_id(self.mir_def_id().to_def_id())
12211221
.as_local()
1222-
.and_then(|def_id| self.infcx.tcx.hir().get_generics(def_id))
1222+
.and_then(|def_id| self.infcx.tcx.hir_get_generics(def_id))
12231223
&& let spans = hir_generics
12241224
.predicates
12251225
.iter()

compiler/rustc_borrowck/src/diagnostics/move_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
347347
// Find the closure that captured the binding.
348348
let mut expr_finder = FindExprBySpan::new(args_span, tcx);
349349
expr_finder.include_closures = true;
350-
expr_finder.visit_expr(tcx.hir().body(body_id).value);
350+
expr_finder.visit_expr(tcx.hir_body(body_id).value);
351351
let Some(closure_expr) = expr_finder.result else { return };
352352
let ExprKind::Closure(closure) = closure_expr.kind else { return };
353353
// We'll only suggest cloning the binding if it's a `move` closure.
@@ -357,7 +357,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
357357
let use_span = use_spans.var_or_use();
358358
let mut expr_finder = FindExprBySpan::new(use_span, tcx);
359359
expr_finder.include_closures = true;
360-
expr_finder.visit_expr(tcx.hir().body(body_id).value);
360+
expr_finder.visit_expr(tcx.hir_body(body_id).value);
361361
let Some(use_expr) = expr_finder.result else { return };
362362
let parent = tcx.parent_hir_node(use_expr.hir_id);
363363
if let Node::Expr(expr) = parent

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -935,11 +935,12 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
935935
fn expected_fn_found_fn_mut_call(&self, err: &mut Diag<'_>, sp: Span, act: &str) {
936936
err.span_label(sp, format!("cannot {act}"));
937937

938-
let hir = self.infcx.tcx.hir();
938+
let tcx = self.infcx.tcx;
939+
let hir = tcx.hir();
939940
let closure_id = self.mir_hir_id();
940-
let closure_span = self.infcx.tcx.def_span(self.mir_def_id());
941-
let fn_call_id = self.infcx.tcx.parent_hir_id(closure_id);
942-
let node = self.infcx.tcx.hir_node(fn_call_id);
941+
let closure_span = tcx.def_span(self.mir_def_id());
942+
let fn_call_id = tcx.parent_hir_id(closure_id);
943+
let node = tcx.hir_node(fn_call_id);
943944
let def_id = hir.enclosing_body_owner(fn_call_id);
944945
let mut look_at_return = true;
945946

@@ -950,7 +951,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
950951
return None;
951952
};
952953

953-
let typeck_results = self.infcx.tcx.typeck(def_id);
954+
let typeck_results = tcx.typeck(def_id);
954955

955956
match kind {
956957
hir::ExprKind::Call(expr, args) => {
@@ -979,7 +980,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
979980
.map(|(pos, _)| pos)
980981
.next();
981982

982-
let arg = match hir.get_if_local(callee_def_id) {
983+
let arg = match tcx.hir_get_if_local(callee_def_id) {
983984
Some(
984985
hir::Node::Item(hir::Item {
985986
ident, kind: hir::ItemKind::Fn { sig, .. }, ..
@@ -1021,7 +1022,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
10211022
if look_at_return && hir.get_fn_id_for_return_block(closure_id).is_some() {
10221023
// ...otherwise we are probably in the tail expression of the function, point at the
10231024
// return type.
1024-
match self.infcx.tcx.hir_node_by_def_id(hir.get_parent_item(fn_call_id).def_id) {
1025+
match tcx.hir_node_by_def_id(hir.get_parent_item(fn_call_id).def_id) {
10251026
hir::Node::Item(hir::Item {
10261027
ident, kind: hir::ItemKind::Fn { sig, .. }, ..
10271028
})
@@ -1049,9 +1050,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
10491050

10501051
fn suggest_using_iter_mut(&self, err: &mut Diag<'_>) {
10511052
let source = self.body.source;
1052-
let hir = self.infcx.tcx.hir();
10531053
if let InstanceKind::Item(def_id) = source.instance
1054-
&& let Some(Node::Expr(hir::Expr { hir_id, kind, .. })) = hir.get_if_local(def_id)
1054+
&& let Some(Node::Expr(hir::Expr { hir_id, kind, .. })) =
1055+
self.infcx.tcx.hir_get_if_local(def_id)
10551056
&& let ExprKind::Closure(hir::Closure { kind: hir::ClosureKind::Closure, .. }) = kind
10561057
&& let Node::Expr(expr) = self.infcx.tcx.parent_hir_node(*hir_id)
10571058
{

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

+7-10
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
207207
lower_bound: RegionVid,
208208
) {
209209
let mut suggestions = vec![];
210-
let hir = self.infcx.tcx.hir();
210+
let tcx = self.infcx.tcx;
211211

212212
// find generic associated types in the given region 'lower_bound'
213213
let gat_id_and_generics = self
@@ -216,12 +216,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
216216
.map(|placeholder| {
217217
if let Some(id) = placeholder.bound.kind.get_id()
218218
&& let Some(placeholder_id) = id.as_local()
219-
&& let gat_hir_id = self.infcx.tcx.local_def_id_to_hir_id(placeholder_id)
220-
&& let Some(generics_impl) = self
221-
.infcx
222-
.tcx
223-
.parent_hir_node(self.infcx.tcx.parent_hir_id(gat_hir_id))
224-
.generics()
219+
&& let gat_hir_id = tcx.local_def_id_to_hir_id(placeholder_id)
220+
&& let Some(generics_impl) =
221+
tcx.parent_hir_node(tcx.parent_hir_id(gat_hir_id)).generics()
225222
{
226223
Some((gat_hir_id, generics_impl))
227224
} else {
@@ -242,7 +239,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
242239
};
243240
if bound_generic_params
244241
.iter()
245-
.rfind(|bgp| self.infcx.tcx.local_def_id_to_hir_id(bgp.def_id) == *gat_hir_id)
242+
.rfind(|bgp| tcx.local_def_id_to_hir_id(bgp.def_id) == *gat_hir_id)
246243
.is_some()
247244
{
248245
for bound in *bounds {
@@ -258,7 +255,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
258255
return;
259256
};
260257
diag.span_note(*trait_span, fluent::borrowck_limitations_implies_static);
261-
let Some(generics_fn) = hir.get_generics(self.body.source.def_id().expect_local())
258+
let Some(generics_fn) = tcx.hir_get_generics(self.body.source.def_id().expect_local())
262259
else {
263260
return;
264261
};
@@ -1156,7 +1153,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
11561153

11571154
if ocx.select_all_or_error().is_empty() && count > 0 {
11581155
diag.span_suggestion_verbose(
1159-
tcx.hir().body(*body).value.peel_blocks().span.shrink_to_lo(),
1156+
tcx.hir_body(*body).value.peel_blocks().span.shrink_to_lo(),
11601157
fluent::borrowck_dereference_suggestion,
11611158
"*".repeat(count),
11621159
Applicability::MachineApplicable,

compiler/rustc_codegen_cranelift/src/driver/jit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ pub(crate) fn run_jit(tcx: TyCtxt<'_>, codegen_mode: CodegenMode, jit_args: Vec<
122122
crate::constant::codegen_static(tcx, &mut jit_module, def_id);
123123
}
124124
MonoItem::GlobalAsm(item_id) => {
125-
let item = tcx.hir().item(item_id);
125+
let item = tcx.hir_item(item_id);
126126
tcx.dcx().span_fatal(item.span, "Global asm is not supported in JIT mode");
127127
}
128128
}

compiler/rustc_codegen_cranelift/src/global_asm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc_target::asm::InlineAsmArch;
1515
use crate::prelude::*;
1616

1717
pub(crate) fn codegen_global_asm_item(tcx: TyCtxt<'_>, global_asm: &mut String, item_id: ItemId) {
18-
let item = tcx.hir().item(item_id);
18+
let item = tcx.hir_item(item_id);
1919
if let rustc_hir::ItemKind::GlobalAsm(asm) = item.kind {
2020
let is_x86 =
2121
matches!(tcx.sess.asm_arch.unwrap(), InlineAsmArch::X86 | InlineAsmArch::X86_64);

compiler/rustc_codegen_ssa/src/mono_item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<'a, 'tcx: 'a> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> {
3535
cx.codegen_static(def_id);
3636
}
3737
MonoItem::GlobalAsm(item_id) => {
38-
let item = cx.tcx().hir().item(item_id);
38+
let item = cx.tcx().hir_item(item_id);
3939
if let hir::ItemKind::GlobalAsm(asm) = item.kind {
4040
let operands: Vec<_> = asm
4141
.operands

compiler/rustc_driver_impl/src/pretty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) {
269269
let attrs = |id| hir_map.attrs(id);
270270
pprust_hir::print_crate(
271271
sm,
272-
hir_map.root_module(),
272+
tcx.hir_root_module(),
273273
src_name,
274274
src,
275275
&attrs,
@@ -290,7 +290,7 @@ pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) {
290290
}
291291
HirTree => {
292292
debug!("pretty printing HIR tree");
293-
format!("{:#?}", ex.tcx().hir().krate())
293+
format!("{:#?}", ex.tcx().hir_krate())
294294
}
295295
Mir => {
296296
let mut out = Vec::new();

compiler/rustc_hir_analysis/src/check/check.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn check_union_fields(tcx: TyCtxt<'_>, span: Span, item_def_id: LocalDefId) -> b
129129
};
130130

131131
if !allowed_union_or_unsafe_field(tcx, field_ty, typing_env, span) {
132-
let (field_span, ty_span) = match tcx.hir().get_if_local(field.did) {
132+
let (field_span, ty_span) = match tcx.hir_get_if_local(field.did) {
133133
// We are currently checking the type this field came from, so it must be local.
134134
Some(Node::Field(field)) => (field.span, field.ty.span),
135135
_ => unreachable!("mir field has to correspond to hir field"),
@@ -913,7 +913,7 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
913913
.emit();
914914
}
915915

916-
let item = tcx.hir().foreign_item(item.id);
916+
let item = tcx.hir_foreign_item(item.id);
917917
match &item.kind {
918918
hir::ForeignItemKind::Fn(sig, _, _) => {
919919
require_c_abi_if_c_variadic(tcx, sig.decl, abi, item.span);
@@ -1527,7 +1527,7 @@ fn detect_discriminant_duplicate<'tcx>(tcx: TyCtxt<'tcx>, adt: ty::AdtDef<'tcx>)
15271527
// In the case the discriminant is both a duplicate and overflowed, let the user know
15281528
if let hir::Node::AnonConst(expr) =
15291529
tcx.hir_node_by_def_id(discr_def_id.expect_local())
1530-
&& let hir::ExprKind::Lit(lit) = &tcx.hir().body(expr.body).value.kind
1530+
&& let hir::ExprKind::Lit(lit) = &tcx.hir_body(expr.body).value.kind
15311531
&& let rustc_ast::LitKind::Int(lit_value, _int_kind) = &lit.node
15321532
&& *lit_value != dis.val
15331533
{

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -640,11 +640,10 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
640640
"method `{}` has an incompatible return type for trait",
641641
trait_m.name
642642
);
643-
let hir = tcx.hir();
644643
infcx.err_ctxt().note_type_err(
645644
&mut diag,
646645
&cause,
647-
hir.get_if_local(impl_m.def_id)
646+
tcx.hir_get_if_local(impl_m.def_id)
648647
.and_then(|node| node.fn_decl())
649648
.map(|decl| (decl.output.span(), Cow::from("return type in trait"), false)),
650649
Some(param_env.and(infer::ValuePairs::Terms(ExpectedFound {
@@ -1102,15 +1101,14 @@ fn check_region_bounds_on_impl_item<'tcx>(
11021101
// the moment, give a kind of vague error message.
11031102
if trait_params != impl_params {
11041103
let span = tcx
1105-
.hir()
1106-
.get_generics(impl_m.def_id.expect_local())
1104+
.hir_get_generics(impl_m.def_id.expect_local())
11071105
.expect("expected impl item to have generics or else we can't compare them")
11081106
.span;
11091107

11101108
let mut generics_span = None;
11111109
let mut bounds_span = vec![];
11121110
let mut where_span = None;
1113-
if let Some(trait_node) = tcx.hir().get_if_local(trait_m.def_id)
1111+
if let Some(trait_node) = tcx.hir_get_if_local(trait_m.def_id)
11141112
&& let Some(trait_generics) = trait_node.generics()
11151113
{
11161114
generics_span = Some(trait_generics.span);
@@ -1125,7 +1123,7 @@ fn check_region_bounds_on_impl_item<'tcx>(
11251123
}
11261124
}
11271125
}
1128-
if let Some(impl_node) = tcx.hir().get_if_local(impl_m.def_id)
1126+
if let Some(impl_node) = tcx.hir_get_if_local(impl_m.def_id)
11291127
&& let Some(impl_generics) = impl_node.generics()
11301128
{
11311129
let mut impl_bounds = 0;

compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub(crate) fn check_refining_return_position_impl_trait_in_trait<'tcx>(
9696

9797
// This opaque also needs to be from the impl method -- otherwise,
9898
// it's a refinement to a TAIT.
99-
if !tcx.hir().get_if_local(impl_opaque.def_id).is_some_and(|node| {
99+
if !tcx.hir_get_if_local(impl_opaque.def_id).is_some_and(|node| {
100100
matches!(
101101
node.expect_opaque_ty().origin,
102102
hir::OpaqueTyOrigin::AsyncFn { parent, .. } | hir::OpaqueTyOrigin::FnReturn { parent, .. }
@@ -327,7 +327,7 @@ fn report_mismatched_rpitit_signature<'tcx>(
327327
hir::FnRetTy::Return(ty) => (ty.span, ty.span, "", ""),
328328
};
329329
let trait_return_span =
330-
tcx.hir().get_if_local(trait_m_def_id).map(|node| match node.fn_decl().unwrap().output {
330+
tcx.hir_get_if_local(trait_m_def_id).map(|node| match node.fn_decl().unwrap().output {
331331
hir::FnRetTy::DefaultReturn(_) => tcx.def_span(trait_m_def_id),
332332
hir::FnRetTy::Return(ty) => ty.span,
333333
});

compiler/rustc_hir_analysis/src/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn get_owner_return_paths(
129129
let hir_id = tcx.local_def_id_to_hir_id(def_id);
130130
let parent_id = tcx.hir().get_parent_item(hir_id).def_id;
131131
tcx.hir_node_by_def_id(parent_id).body_id().map(|body_id| {
132-
let body = tcx.hir().body(body_id);
132+
let body = tcx.hir_body(body_id);
133133
let mut visitor = ReturnsVisitor::default();
134134
visitor.visit_body(body);
135135
(parent_id, visitor)

compiler/rustc_hir_analysis/src/check/region.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ fn resolve_expr<'tcx>(visitor: &mut ScopeResolutionVisitor<'tcx>, expr: &'tcx hi
424424
// that share the parent environment. We handle const blocks in
425425
// `visit_inline_const`.
426426
hir::ExprKind::Closure(&hir::Closure { body, .. }) => {
427-
let body = visitor.tcx.hir().body(body);
427+
let body = visitor.tcx.hir_body(body);
428428
visitor.visit_body(body);
429429
}
430430
hir::ExprKind::AssignOp(_, left_expr, right_expr) => {
@@ -906,7 +906,7 @@ impl<'tcx> Visitor<'tcx> for ScopeResolutionVisitor<'tcx> {
906906
resolve_local(self, Some(l.pat), l.init)
907907
}
908908
fn visit_inline_const(&mut self, c: &'tcx hir::ConstBlock) {
909-
let body = self.tcx.hir().body(c.body);
909+
let body = self.tcx.hir_body(c.body);
910910
self.visit_body(body);
911911
}
912912
}

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ fn check_type_defn<'tcx>(
11131113
// be refactored to check the instantiate-ability of the code better.
11141114
if let Some(def_id) = def_id.as_local()
11151115
&& let hir::Node::AnonConst(anon) = tcx.hir_node_by_def_id(def_id)
1116-
&& let expr = &tcx.hir().body(anon.body).value
1116+
&& let expr = &tcx.hir_body(anon.body).value
11171117
&& let hir::ExprKind::Path(hir::QPath::Resolved(None, path)) = expr.kind
11181118
&& let Res::Def(DefKind::ConstParam, _def_id) = path.res
11191119
{

compiler/rustc_hir_analysis/src/coherence/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ fn infringing_fields_error<'tcx>(
674674

675675
suggest_constraining_type_params(
676676
tcx,
677-
tcx.hir().get_generics(impl_did).expect("impls always have generics"),
677+
tcx.hir_get_generics(impl_did).expect("impls always have generics"),
678678
&mut err,
679679
bounds
680680
.iter()

compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub(crate) fn crate_inherent_impls(
2525
let mut collect = InherentCollect { tcx, impls_map: Default::default() };
2626

2727
let mut res = Ok(());
28-
for id in tcx.hir().items() {
28+
for id in tcx.hir_items() {
2929
res = res.and(collect.check_item(id));
3030
}
3131

compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub(crate) fn crate_inherent_impls_overlap_check(
1818
) -> Result<(), ErrorGuaranteed> {
1919
let mut inherent_overlap_checker = InherentOverlapChecker { tcx };
2020
let mut res = Ok(());
21-
for id in tcx.hir().items() {
21+
for id in tcx.hir_items() {
2222
res = res.and(inherent_overlap_checker.check_item(id));
2323
}
2424
res

0 commit comments

Comments
 (0)