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:
commit
3d4464d4d7
37 changed files with 135 additions and 199 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue