summary refs log tree commit diff
path: root/src/librustc/hir/map/mod.rs
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2019-02-18 14:53:25 +0100
committerljedrz <ljedrz@gmail.com>2019-02-24 07:50:46 +0100
commite4f8a6bcc1ecc3715a025c3a56ebf06c117ba767 (patch)
tree071760ed2cdca313245d1c1d09fde975b13215fc /src/librustc/hir/map/mod.rs
parent1c18ac1f65ad87709e962176fb84a17d570cafb9 (diff)
downloadrust-e4f8a6bcc1ecc3715a025c3a56ebf06c117ba767.tar.gz
rust-e4f8a6bcc1ecc3715a025c3a56ebf06c117ba767.zip
hir: remove NodeId from GenericParam
Diffstat (limited to 'src/librustc/hir/map/mod.rs')
-rw-r--r--src/librustc/hir/map/mod.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/librustc/hir/map/mod.rs b/src/librustc/hir/map/mod.rs
index 39203208855..052802810f0 100644
--- a/src/librustc/hir/map/mod.rs
+++ b/src/librustc/hir/map/mod.rs
@@ -395,9 +395,14 @@ impl<'hir> Map<'hir> {
             }
             Node::GenericParam(param) => {
                 Some(match param.kind {
-                    GenericParamKind::Lifetime { .. } => Def::Local(param.id),
-                    GenericParamKind::Type { .. } => Def::TyParam(self.local_def_id(param.id)),
-                    GenericParamKind::Const { .. } => Def::ConstParam(self.local_def_id(param.id)),
+                    GenericParamKind::Lifetime { .. } => {
+                        let node_id = self.hir_to_node_id(param.hir_id);
+                        Def::Local(node_id)
+                    },
+                    GenericParamKind::Type { .. } => Def::TyParam(
+                        self.local_def_id_from_hir_id(param.hir_id)),
+                    GenericParamKind::Const { .. } => Def::ConstParam(
+                        self.local_def_id_from_hir_id(param.hir_id)),
                 })
             }
         }