1
Fork 0

Rollup merge of #122513 - petrochenkov:somehir4, r=fmease

hir: Remove `opt_local_def_id_to_hir_id` and `opt_hir_node_by_def_id`

Also replace a few `hir_node()` calls with `hir_node_by_def_id()`.

Follow up to https://github.com/rust-lang/rust/pull/120943.
This commit is contained in:
Guillaume Gomez 2024-03-15 17:24:09 +01:00 committed by GitHub
commit 3d4464d4d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 135 additions and 199 deletions

View file

@ -325,11 +325,7 @@ fn associated_type_for_impl_trait_in_impl(
) -> LocalDefId {
let impl_local_def_id = tcx.local_parent(impl_fn_def_id);
let decl = tcx
.opt_hir_node_by_def_id(impl_fn_def_id)
.expect("expected item")
.fn_decl()
.expect("expected decl");
let decl = tcx.hir_node_by_def_id(impl_fn_def_id).fn_decl().expect("expected decl");
let span = match decl.output {
hir::FnRetTy::DefaultReturn(_) => tcx.def_span(impl_fn_def_id),
hir::FnRetTy::Return(ty) => ty.span,