Skip to content

Commit d53ddcd

Browse files
committedJan 31, 2024
Auto merge of #120346 - petrochenkov:ownodes, r=oli-obk
hir: Refactor getters for owner nodes
·
1.87.01.77.0
2 parents 80deabd + db41f4a commit d53ddcd

Some content is hidden

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

49 files changed

+918
-925
lines changed
 

‎compiler/rustc_hir_analysis/src/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ pub fn check_function_signature<'tcx>(
578578
fn_id: LocalDefId,
579579
) -> rustc_span::Span {
580580
let mut args = {
581-
let node = tcx.hir().expect_owner(fn_id);
581+
let node = tcx.expect_hir_owner_node(fn_id);
582582
let decl = node.fn_decl().unwrap_or_else(|| bug!("expected fn decl, found {:?}", node));
583583
decl.inputs.iter().map(|t| t.span).chain(std::iter::once(decl.output.span()))
584584
};

‎compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ where
188188
}
189189

190190
fn check_well_formed(tcx: TyCtxt<'_>, def_id: hir::OwnerId) -> Result<(), ErrorGuaranteed> {
191-
let node = tcx.hir().owner(def_id);
191+
let node = tcx.hir_owner_node(def_id);
192192
let mut res = match node {
193193
hir::OwnerNode::Crate(_) => bug!("check_well_formed cannot be applied to the crate root"),
194194
hir::OwnerNode::Item(item) => check_item(tcx, item),

0 commit comments

Comments
 (0)
Please sign in to comment.