Rollup merge of #80232 - bugadani:roundtrip, r=estebank
Remove redundant def_id lookups Simplify `DefId -> LocalDefId -> HirId -> LocalDefId -> DefId` chains.
This commit is contained in:
commit
ac7267a5e7
2 changed files with 2 additions and 4 deletions
|
@ -92,8 +92,7 @@ impl<'tcx> Const<'tcx> {
|
|||
let item_id = tcx.hir().get_parent_node(hir_id);
|
||||
let item_def_id = tcx.hir().local_def_id(item_id);
|
||||
let generics = tcx.generics_of(item_def_id.to_def_id());
|
||||
let index =
|
||||
generics.param_def_id_to_index[&tcx.hir().local_def_id(hir_id).to_def_id()];
|
||||
let index = generics.param_def_id_to_index[&def_id];
|
||||
let name = tcx.hir().name(hir_id);
|
||||
ty::ConstKind::Param(ty::ParamConst::new(index, name))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue