Skip to content

Commit fd7b4bf

Browse files
committed
Move methods from Map to TyCtxt, part 2.
Continuing the work started in #136466. Every method gains a `hir_` prefix, though for the ones that already have a `par_` or `try_par_` prefix I added the `hir_` after that.
1 parent ce36a96 commit fd7b4bf

File tree

108 files changed

+314
-346
lines changed

Some content is hidden

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

108 files changed

+314
-346
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
386386
hir::intravisit::walk_pat(self, p);
387387
}
388388
}
389+
let tcx = self.infcx.tcx;
389390
let hir = self.infcx.tcx.hir();
390-
if let Some(body) = hir.maybe_body_owned_by(self.mir_def_id()) {
391+
if let Some(body) = tcx.hir_maybe_body_owned_by(self.mir_def_id()) {
391392
let expr = body.value;
392393
let place = &self.move_data.move_paths[mpi].place;
393394
let span = place.as_local().map(|local| self.body.local_decls[local].source_info.span);
@@ -396,7 +397,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
396397
expr: None,
397398
pat: None,
398399
parent_pat: None,
399-
tcx: self.infcx.tcx,
400+
tcx,
400401
};
401402
finder.visit_expr(expr);
402403
if let Some(span) = span
@@ -782,9 +783,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
782783

783784
// We use the statements were the binding was initialized, and inspect the HIR to look
784785
// for the branching codepaths that aren't covered, to point at them.
785-
let map = self.infcx.tcx.hir();
786-
let body = map.body_owned_by(self.mir_def_id());
787-
let mut visitor = ConditionVisitor { tcx: self.infcx.tcx, spans, name, errors: vec![] };
786+
let tcx = self.infcx.tcx;
787+
let body = tcx.hir_body_owned_by(self.mir_def_id());
788+
let mut visitor = ConditionVisitor { tcx, spans, name, errors: vec![] };
788789
visitor.visit_body(&body);
789790
let spans = visitor.spans;
790791

@@ -2443,7 +2444,6 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
24432444
) {
24442445
let &UseSpans::ClosureUse { capture_kind_span, .. } = issued_spans else { return };
24452446
let tcx = self.infcx.tcx;
2446-
let hir = tcx.hir();
24472447

24482448
// Get the type of the local that we are trying to borrow
24492449
let local = borrowed_place.local;
@@ -2522,7 +2522,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
25222522

25232523
// Find the first argument with a matching type, get its name
25242524
let Some((_, this_name)) =
2525-
params.iter().zip(hir.body_param_names(closure.body)).find(|(param_ty, name)| {
2525+
params.iter().zip(tcx.hir_body_param_names(closure.body)).find(|(param_ty, name)| {
25262526
// FIXME: also support deref for stuff like `Rc` arguments
25272527
param_ty.peel_refs() == local_ty && name != &Ident::empty()
25282528
})
@@ -4178,7 +4178,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
41784178
debug!("annotate_fn_sig: did={:?} sig={:?}", did, sig);
41794179
let is_closure = self.infcx.tcx.is_closure_like(did.to_def_id());
41804180
let fn_hir_id = self.infcx.tcx.local_def_id_to_hir_id(did);
4181-
let fn_decl = self.infcx.tcx.hir().fn_decl_by_hir_id(fn_hir_id)?;
4181+
let fn_decl = self.infcx.tcx.hir_fn_decl_by_hir_id(fn_hir_id)?;
41824182

41834183
// We need to work out which arguments to highlight. We do this by looking
41844184
// at the return type, where there are three cases:

compiler/rustc_borrowck/src/diagnostics/move_errors.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -777,12 +777,12 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
777777
}
778778
let Some(pat_span) = pat_span else { return };
779779

780-
let hir = self.infcx.tcx.hir();
781-
let Some(body) = hir.maybe_body_owned_by(self.mir_def_id()) else { return };
780+
let tcx = self.infcx.tcx;
781+
let Some(body) = tcx.hir_maybe_body_owned_by(self.mir_def_id()) else { return };
782782
let typeck_results = self.infcx.tcx.typeck(self.mir_def_id());
783783
let mut finder = BindingFinder {
784784
typeck_results,
785-
tcx: self.infcx.tcx,
785+
tcx,
786786
pat_span,
787787
binding_spans,
788788
found_pat: false,

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

+10-13
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
648648
}
649649
}
650650
}
651-
let hir_map = self.infcx.tcx.hir();
652651
let def_id = self.body.source.def_id();
653652
let Some(local_def_id) = def_id.as_local() else { return };
654-
let Some(body) = hir_map.maybe_body_owned_by(local_def_id) else { return };
653+
let Some(body) = self.infcx.tcx.hir_maybe_body_owned_by(local_def_id) else { return };
655654

656655
let mut v = SuggestIndexOperatorAlternativeVisitor {
657656
assign_span: span,
@@ -749,7 +748,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
749748
// `fn foo(&x: &i32)` -> `fn foo(&(mut x): &i32)`
750749
let def_id = self.body.source.def_id();
751750
if let Some(local_def_id) = def_id.as_local()
752-
&& let Some(body) = self.infcx.tcx.hir().maybe_body_owned_by(local_def_id)
751+
&& let Some(body) = self.infcx.tcx.hir_maybe_body_owned_by(local_def_id)
753752
&& let Some(hir_id) = (BindingFinder { span: pat_span }).visit_body(&body).break_value()
754753
&& let node = self.infcx.tcx.hir_node(hir_id)
755754
&& let hir::Node::LetStmt(hir::LetStmt {
@@ -856,7 +855,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
856855
use hir::ExprKind::{AddrOf, Block, Call, MethodCall};
857856
use hir::{BorrowKind, Expr};
858857

859-
let hir_map = self.infcx.tcx.hir();
858+
let tcx = self.infcx.tcx;
860859
struct Finder {
861860
span: Span,
862861
}
@@ -871,7 +870,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
871870
}
872871
}
873872
}
874-
if let Some(body) = hir_map.maybe_body_owned_by(self.mir_def_id())
873+
if let Some(body) = tcx.hir_maybe_body_owned_by(self.mir_def_id())
875874
&& let Block(block, _) = body.value.kind
876875
{
877876
// `span` corresponds to the expression being iterated, find the `for`-loop desugared
@@ -884,17 +883,15 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
884883
MethodCall(path_segment, _, _, span) => {
885884
// We have `for _ in iter.read_only_iter()`, try to
886885
// suggest `for _ in iter.mutable_iter()` instead.
887-
let opt_suggestions = self
888-
.infcx
889-
.tcx
886+
let opt_suggestions = tcx
890887
.typeck(path_segment.hir_id.owner.def_id)
891888
.type_dependent_def_id(expr.hir_id)
892-
.and_then(|def_id| self.infcx.tcx.impl_of_method(def_id))
893-
.map(|def_id| self.infcx.tcx.associated_items(def_id))
889+
.and_then(|def_id| tcx.impl_of_method(def_id))
890+
.map(|def_id| tcx.associated_items(def_id))
894891
.map(|assoc_items| {
895892
assoc_items
896893
.in_definition_order()
897-
.map(|assoc_item_def| assoc_item_def.ident(self.infcx.tcx))
894+
.map(|assoc_item_def| assoc_item_def.ident(tcx))
898895
.filter(|&ident| {
899896
let original_method_ident = path_segment.ident;
900897
original_method_ident != ident
@@ -942,7 +939,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
942939
let closure_span = tcx.def_span(self.mir_def_id());
943940
let fn_call_id = tcx.parent_hir_id(closure_id);
944941
let node = tcx.hir_node(fn_call_id);
945-
let def_id = hir.enclosing_body_owner(fn_call_id);
942+
let def_id = tcx.hir_enclosing_body_owner(fn_call_id);
946943
let mut look_at_return = true;
947944

948945
// If the HIR node is a function or method call gets the def ID
@@ -1275,7 +1272,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
12751272
}) => {
12761273
let def_id = self.body.source.def_id();
12771274
let hir_id = if let Some(local_def_id) = def_id.as_local()
1278-
&& let Some(body) = self.infcx.tcx.hir().maybe_body_owned_by(local_def_id)
1275+
&& let Some(body) = self.infcx.tcx.hir_maybe_body_owned_by(local_def_id)
12791276
{
12801277
BindingFinder { span: err_label_span }.visit_body(&body).break_value()
12811278
} else {

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1169,8 +1169,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
11691169

11701170
#[allow(rustc::diagnostic_outside_of_impl)]
11711171
fn suggest_move_on_borrowing_closure(&self, diag: &mut Diag<'_>) {
1172-
let map = self.infcx.tcx.hir();
1173-
let body = map.body_owned_by(self.mir_def_id());
1172+
let body = self.infcx.tcx.hir_body_owned_by(self.mir_def_id());
11741173
let expr = &body.value.peel_blocks();
11751174
let mut closure_span = None::<rustc_span::Span>;
11761175
match expr.kind {

compiler/rustc_borrowck/src/diagnostics/region_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
424424
&self,
425425
argument_index: usize,
426426
) -> Option<&hir::Ty<'tcx>> {
427-
let fn_decl = self.infcx.tcx.hir().fn_decl_by_hir_id(self.mir_hir_id())?;
427+
let fn_decl = self.infcx.tcx.hir_fn_decl_by_hir_id(self.mir_hir_id())?;
428428
let argument_hir_ty: &hir::Ty<'_> = fn_decl.inputs.get(argument_index)?;
429429
match argument_hir_ty.kind {
430430
// This indicates a variable with no type annotation, like

compiler/rustc_borrowck/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ fn do_mir_borrowck<'tcx>(
188188
.iterate_to_fixpoint(tcx, body, Some("borrowck"))
189189
.into_results_cursor(body);
190190

191-
let locals_are_invalidated_at_exit = tcx.hir().body_owner_kind(def).is_fn_or_closure();
191+
let locals_are_invalidated_at_exit = tcx.hir_body_owner_kind(def).is_fn_or_closure();
192192
let borrow_set = BorrowSet::build(tcx, body, locals_are_invalidated_at_exit, &move_data);
193193

194194
// Compute non-lexical lifetimes.

compiler/rustc_borrowck/src/universal_regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
576576
let tcx = self.infcx.tcx;
577577
let typeck_root_def_id = tcx.typeck_root_def_id(self.mir_def.to_def_id());
578578

579-
match tcx.hir().body_owner_kind(self.mir_def) {
579+
match tcx.hir_body_owner_kind(self.mir_def) {
580580
BodyOwnerKind::Closure | BodyOwnerKind::Fn => {
581581
let defining_ty = tcx.type_of(self.mir_def).instantiate_identity();
582582

compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub(crate) fn get_or_insert_gdb_debug_scripts_section_global<'ll>(
8787

8888
pub(crate) fn needs_gdb_debug_scripts_section(cx: &CodegenCx<'_, '_>) -> bool {
8989
let omit_gdb_pretty_printer_section =
90-
attr::contains_name(cx.tcx.hir().krate_attrs(), sym::omit_gdb_pretty_printer_section);
90+
attr::contains_name(cx.tcx.hir_krate_attrs(), sym::omit_gdb_pretty_printer_section);
9191

9292
// To ensure the section `__rustc_debug_gdb_scripts_section__` will not create
9393
// ODR violations at link time, this section will not be emitted for rlibs since

compiler/rustc_const_eval/src/check_consts/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub struct ConstCx<'mir, 'tcx> {
3131
impl<'mir, 'tcx> ConstCx<'mir, 'tcx> {
3232
pub fn new(tcx: TyCtxt<'tcx>, body: &'mir mir::Body<'tcx>) -> Self {
3333
let typing_env = body.typing_env(tcx);
34-
let const_kind = tcx.hir().body_const_context(body.source.def_id().expect_local());
34+
let const_kind = tcx.hir_body_const_context(body.source.def_id().expect_local());
3535
ConstCx { body, tcx, typing_env, const_kind }
3636
}
3737

compiler/rustc_driver_impl/src/pretty.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ impl<'tcx> pprust_hir::PpAnn for HirTypedAnn<'tcx> {
164164
if let pprust_hir::AnnNode::Expr(expr) = node {
165165
let typeck_results = self.maybe_typeck_results.get().or_else(|| {
166166
self.tcx
167-
.hir()
168-
.maybe_body_owned_by(expr.hir_id.owner.def_id)
167+
.hir_maybe_body_owned_by(expr.hir_id.owner.def_id)
169168
.map(|body_id| self.tcx.typeck_body(body_id.id()))
170169
});
171170

@@ -317,7 +316,7 @@ pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) {
317316
rustc_hir_analysis::check_crate(tcx);
318317
tcx.dcx().abort_if_errors();
319318
debug!("pretty printing THIR tree");
320-
for did in tcx.hir().body_owners() {
319+
for did in tcx.hir_body_owners() {
321320
let _ = writeln!(out, "{:?}:\n{}\n", did, thir_tree(tcx, did));
322321
}
323322
out
@@ -328,7 +327,7 @@ pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) {
328327
rustc_hir_analysis::check_crate(tcx);
329328
tcx.dcx().abort_if_errors();
330329
debug!("pretty printing THIR flat");
331-
for did in tcx.hir().body_owners() {
330+
for did in tcx.hir_body_owners() {
332331
let _ = writeln!(out, "{:?}:\n{}\n", did, thir_flat(tcx, did));
333332
}
334333
out

compiler/rustc_hir/src/intravisit.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//! - Example: Examine each expression to look for its type and do some check or other.
2020
//! - How: Implement `intravisit::Visitor` and override the `NestedFilter` type to
2121
//! `nested_filter::OnlyBodies` (and implement `maybe_tcx`), and use
22-
//! `tcx.hir().visit_all_item_likes_in_crate(&mut visitor)`. Within your
22+
//! `tcx.hir_visit_all_item_likes_in_crate(&mut visitor)`. Within your
2323
//! `intravisit::Visitor` impl, implement methods like `visit_expr()` (don't forget to invoke
2424
//! `intravisit::walk_expr()` to keep walking the subparts).
2525
//! - Pro: Visitor methods for any kind of HIR node, not just item-like things.
@@ -31,7 +31,7 @@
3131
//! impl into scope while visiting the impl-items, and then back out again.
3232
//! - How: Implement `intravisit::Visitor` and override the `NestedFilter` type to
3333
//! `nested_filter::All` (and implement `maybe_tcx`). Walk your crate with
34-
//! `tcx.hir().walk_toplevel_module(visitor)` invoked on `tcx.hir().krate()`.
34+
//! `tcx.hir_walk_toplevel_module(visitor)`.
3535
//! - Pro: Visitor methods for any kind of HIR node, not just item-like things.
3636
//! - Pro: Preserves nesting information
3737
//! - Con: Does not integrate well into dependency tracking.
@@ -193,7 +193,7 @@ use nested_filter::NestedFilter;
193193
/// (this is why the module is called `intravisit`, to distinguish it
194194
/// from the AST's `visit` module, which acts differently). If you
195195
/// simply want to visit all items in the crate in some order, you
196-
/// should call `tcx.hir().visit_all_item_likes_in_crate`. Otherwise, see the comment
196+
/// should call `tcx.hir_visit_all_item_likes_in_crate`. Otherwise, see the comment
197197
/// on `visit_nested_item` for details on how to visit nested items.
198198
///
199199
/// If you want to ensure that your code handles every variant

compiler/rustc_hir_analysis/src/check/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ fn best_definition_site_of_opaque<'tcx>(
484484
hir::OpaqueTyOrigin::TyAlias { in_assoc_ty: false, .. } => {
485485
let scope = tcx.hir().get_defining_scope(tcx.local_def_id_to_hir_id(opaque_def_id));
486486
let found = if scope == hir::CRATE_HIR_ID {
487-
tcx.hir().walk_toplevel_module(&mut locator)
487+
tcx.hir_walk_toplevel_module(&mut locator)
488488
} else {
489489
match tcx.hir_node(scope) {
490490
Node::Item(it) => locator.visit_item(it),

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
501501
check_method_is_structurally_compatible(tcx, impl_m, trait_m, impl_trait_ref, true)?;
502502

503503
let impl_m_hir_id = tcx.local_def_id_to_hir_id(impl_m_def_id);
504-
let return_span = tcx.hir().fn_decl_by_hir_id(impl_m_hir_id).unwrap().output.span();
504+
let return_span = tcx.hir_fn_decl_by_hir_id(impl_m_hir_id).unwrap().output.span();
505505
let cause = ObligationCause::new(
506506
return_span,
507507
impl_m_def_id,
@@ -1033,8 +1033,7 @@ fn report_trait_method_mismatch<'tcx>(
10331033
// argument pattern and type.
10341034
let (sig, body) = tcx.hir().expect_impl_item(impl_m.def_id.expect_local()).expect_fn();
10351035
let span = tcx
1036-
.hir()
1037-
.body_param_names(body)
1036+
.hir_body_param_names(body)
10381037
.zip(sig.decl.inputs.iter())
10391038
.map(|(param, ty)| param.span.to(ty.span))
10401039
.next()

compiler/rustc_hir_analysis/src/check/region.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ impl<'tcx> Visitor<'tcx> for ScopeResolutionVisitor<'tcx> {
844844

845845
fn visit_body(&mut self, body: &hir::Body<'tcx>) {
846846
let body_id = body.id();
847-
let owner_id = self.tcx.hir().body_owner_def_id(body_id);
847+
let owner_id = self.tcx.hir_body_owner_def_id(body_id);
848848

849849
debug!(
850850
"visit_body(id={:?}, span={:?}, body.id={:?}, cx.parent={:?})",
@@ -855,7 +855,7 @@ impl<'tcx> Visitor<'tcx> for ScopeResolutionVisitor<'tcx> {
855855
);
856856

857857
self.enter_body(body.value.hir_id, |this| {
858-
if this.tcx.hir().body_owner_kind(owner_id).is_fn_or_closure() {
858+
if this.tcx.hir_body_owner_kind(owner_id).is_fn_or_closure() {
859859
// The arguments and `self` are parented to the fn.
860860
this.cx.var_parent = this.cx.parent.take();
861861
for param in body.params {
@@ -924,7 +924,7 @@ pub(crate) fn region_scope_tree(tcx: TyCtxt<'_>, def_id: DefId) -> &ScopeTree {
924924
return tcx.region_scope_tree(typeck_root_def_id);
925925
}
926926

927-
let scope_tree = if let Some(body) = tcx.hir().maybe_body_owned_by(def_id.expect_local()) {
927+
let scope_tree = if let Some(body) = tcx.hir_maybe_body_owned_by(def_id.expect_local()) {
928928
let mut visitor = ScopeResolutionVisitor {
929929
tcx,
930930
scope_tree: ScopeTree::default(),

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ fn check_sized_if_body<'tcx>(
17101710
maybe_span: Option<Span>,
17111711
) {
17121712
let tcx = wfcx.tcx();
1713-
if let Some(body) = tcx.hir().maybe_body_owned_by(def_id) {
1713+
if let Some(body) = tcx.hir_maybe_body_owned_by(def_id) {
17141714
let span = maybe_span.unwrap_or(body.value.span);
17151715

17161716
wfcx.register_bound(

compiler/rustc_hir_analysis/src/check_unused.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ pub(crate) fn provide(providers: &mut Providers) {
1313
fn check_unused_traits(tcx: TyCtxt<'_>, (): ()) {
1414
let mut used_trait_imports = UnordSet::<LocalDefId>::default();
1515

16-
// FIXME: Use `tcx.hir().par_body_owners()` when we implement creating `DefId`s
16+
// FIXME: Use `tcx.hir_par_body_owners()` when we implement creating `DefId`s
1717
// for anon constants during their parents' typeck.
1818
// Doing so at current will produce queries cycle errors because it may typeck
1919
// on anon constants directly.
20-
for item_def_id in tcx.hir().body_owners() {
20+
for item_def_id in tcx.hir_body_owners() {
2121
let imports = tcx.used_trait_imports(item_def_id);
2222
debug!("GatherVisitor: item_def_id={:?} with imports {:#?}", item_def_id, imports);
2323
used_trait_imports.extend_unord(imports.items().copied());

compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'tcx> InherentCollect<'tcx> {
113113
ty: Ty<'tcx>,
114114
) -> Result<(), ErrorGuaranteed> {
115115
let items = self.tcx.associated_item_def_ids(impl_def_id);
116-
if !self.tcx.hir().rustc_coherence_is_core() {
116+
if !self.tcx.hir_rustc_coherence_is_core() {
117117
if self.tcx.features().rustc_attrs() {
118118
for &impl_item in items {
119119
if !self.tcx.has_attr(impl_item, sym::rustc_allow_incoherent_impl) {

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ fn const_evaluatable_predicates_of<'tcx>(
435435
self_ty.instantiate_identity().visit_with(&mut collector);
436436
}
437437

438-
if let Some(_) = tcx.hir().fn_sig_by_hir_id(hir_id) {
438+
if let Some(_) = tcx.hir_fn_sig_by_hir_id(hir_id) {
439439
debug!("visit fn sig");
440440
let fn_sig = tcx.fn_sig(def_id);
441441
let fn_sig = fn_sig.instantiate_identity();
@@ -825,7 +825,7 @@ pub(super) fn type_param_predicates<'tcx>(
825825
// `where T: Foo`.
826826

827827
let param_id = tcx.local_def_id_to_hir_id(def_id);
828-
let param_owner = tcx.hir().ty_param_owner(def_id);
828+
let param_owner = tcx.hir_ty_param_owner(def_id);
829829

830830
// Don't look for bounds where the type parameter isn't in scope.
831831
let parent = if item_def_id == param_owner {

0 commit comments

Comments
 (0)