diff options
| author | ljedrz <ljedrz@gmail.com> | 2019-02-18 14:53:25 +0100 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2019-02-24 07:50:46 +0100 |
| commit | e4f8a6bcc1ecc3715a025c3a56ebf06c117ba767 (patch) | |
| tree | 071760ed2cdca313245d1c1d09fde975b13215fc /src/librustc/hir | |
| parent | 1c18ac1f65ad87709e962176fb84a17d570cafb9 (diff) | |
| download | rust-e4f8a6bcc1ecc3715a025c3a56ebf06c117ba767.tar.gz rust-e4f8a6bcc1ecc3715a025c3a56ebf06c117ba767.zip | |
hir: remove NodeId from GenericParam
Diffstat (limited to 'src/librustc/hir')
| -rw-r--r-- | src/librustc/hir/lowering.rs | 6 | ||||
| -rw-r--r-- | src/librustc/hir/map/mod.rs | 11 | ||||
| -rw-r--r-- | src/librustc/hir/mod.rs | 3 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index f4452555ba6..f551eb48c6c 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -780,7 +780,6 @@ impl<'a> LoweringContext<'a> { ); hir::GenericParam { - id: node_id, hir_id, name: hir_name, attrs: hir_vec![], @@ -1300,7 +1299,6 @@ impl<'a> LoweringContext<'a> { // Set the name to `impl Bound1 + Bound2`. let ident = Ident::from_str(&pprust::ty_to_string(t)).with_span_pos(span); in_band_ty_params.push(hir::GenericParam { - id: def_node_id, hir_id, name: ParamName::Plain(ident), pure_wrt_drop: false, @@ -1567,7 +1565,6 @@ impl<'a> LoweringContext<'a> { }; self.output_lifetime_params.push(hir::GenericParam { - id: def_node_id, hir_id, name, span: lifetime.span, @@ -2519,10 +2516,9 @@ impl<'a> LoweringContext<'a> { } }; - let LoweredNodeId { node_id, hir_id } = self.lower_node_id(param.id); + let LoweredNodeId { node_id: _, hir_id } = self.lower_node_id(param.id); hir::GenericParam { - id: node_id, hir_id, name, span: param.ident.span, 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)), }) } } diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index f655b9fe4c8..a5b61f002f7 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -420,7 +420,7 @@ impl GenericArg { match self { GenericArg::Lifetime(l) => l.hir_id, GenericArg::Type(t) => t.hir_id, - GenericArg::Const(c) => c.value.id, + GenericArg::Const(c) => c.value.hir_id, } } } @@ -552,7 +552,6 @@ pub enum GenericParamKind { #[derive(Clone, RustcEncodable, RustcDecodable, Debug)] pub struct GenericParam { - pub id: NodeId, pub hir_id: HirId, pub name: ParamName, pub attrs: HirVec<Attribute>, |
