diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-01-13 03:20:13 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-13 03:20:13 +0100 |
| commit | ac7267a5e78716f08650a513f91c5d901b4a1f28 (patch) | |
| tree | 51a0fbe9c8a23be8de58904c385531583e969274 /compiler/rustc_mir_build | |
| parent | 11bca6b07fc7b21e1c0ac9a011988b43468e9fe6 (diff) | |
| parent | a189cb2b6d30a5c3af268c11683d3e2b430e8e89 (diff) | |
| download | rust-ac7267a5e78716f08650a513f91c5d901b4a1f28.tar.gz rust-ac7267a5e78716f08650a513f91c5d901b4a1f28.zip | |
Rollup merge of #80232 - bugadani:roundtrip, r=estebank
Remove redundant def_id lookups Simplify `DefId -> LocalDefId -> HirId -> LocalDefId -> DefId` chains.
Diffstat (limited to 'compiler/rustc_mir_build')
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/cx/expr.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs index 417f9bded09..625a0989ab3 100644 --- a/compiler/rustc_mir_build/src/thir/cx/expr.rs +++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs @@ -813,8 +813,7 @@ fn convert_path_expr<'a, 'tcx>( let item_id = cx.tcx.hir().get_parent_node(hir_id); let item_def_id = cx.tcx.hir().local_def_id(item_id); let generics = cx.tcx.generics_of(item_def_id); - let local_def_id = cx.tcx.hir().local_def_id(hir_id); - let index = generics.param_def_id_to_index[&local_def_id.to_def_id()]; + let index = generics.param_def_id_to_index[&def_id]; let name = cx.tcx.hir().name(hir_id); let val = ty::ConstKind::Param(ty::ParamConst::new(index, name)); ExprKind::Literal { |
