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()`
This commit is contained in:
Vadim Petrochenkov 2024-03-14 21:05:06 +03:00
parent 30f74ff0dc
commit 89b536dbc8
37 changed files with 135 additions and 199 deletions

View file

@ -319,11 +319,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,