diff options
| author | ljedrz <ljedrz@gmail.com> | 2019-03-06 14:44:24 +0100 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2019-03-07 09:25:51 +0100 |
| commit | 78f91e39766768248fa77c42a14c3a609be53904 (patch) | |
| tree | 5e4b88b69f5c7d8be93a2989badf1afad23b0f66 | |
| parent | cd06038b54687bb4040e3d0a8b7bc4e8a3618ba8 (diff) | |
| download | rust-78f91e39766768248fa77c42a14c3a609be53904.tar.gz rust-78f91e39766768248fa77c42a14c3a609be53904.zip | |
hir: remove NodeId from PathSegment
| -rw-r--r-- | src/librustc/hir/lowering.rs | 11 | ||||
| -rw-r--r-- | src/librustc/hir/mod.rs | 4 | ||||
| -rw-r--r-- | src/librustc/ich/impls_hir.rs | 1 | ||||
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 1 | ||||
| -rw-r--r-- | src/librustdoc/core.rs | 1 |
5 files changed, 4 insertions, 14 deletions
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 52ad800e81c..6b3111688d8 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -1932,7 +1932,6 @@ impl<'a> LoweringContext<'a> { hir::PathSegment::new( segment.ident, - Some(id.node_id), Some(id.hir_id), Some(def), generic_args, @@ -3276,10 +3275,8 @@ impl<'a> LoweringContext<'a> { debug!("renumber_segment_ids(path = {:?})", path); let mut path = path.clone(); for seg in path.segments.iter_mut() { - if seg.id.is_some() { - let next_id = self.next_id(); - seg.id = Some(next_id.node_id); - seg.hir_id = Some(next_id.hir_id); + if seg.hir_id.is_some() { + seg.hir_id = Some(self.next_id().hir_id); } } path @@ -5024,8 +5021,8 @@ impl<'a> LoweringContext<'a> { for seg in path.segments.iter_mut() { - if let Some(id) = seg.id { - seg.id = Some(self.lower_node_id(id).node_id); + if seg.hir_id.is_some() { + seg.hir_id = Some(self.next_id().hir_id); } } path diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 2d0296aa38c..1bf3ec88f36 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -327,7 +327,6 @@ pub struct PathSegment { // therefore will not have 'jump to def' in IDEs, but otherwise will not be // affected. (In general, we don't bother to get the defs for synthesized // segments, only for segments which have come from the AST). - pub id: Option<NodeId>, pub hir_id: Option<HirId>, pub def: Option<Def>, @@ -350,7 +349,6 @@ impl PathSegment { pub fn from_ident(ident: Ident) -> PathSegment { PathSegment { ident, - id: None, hir_id: None, def: None, infer_types: true, @@ -360,7 +358,6 @@ impl PathSegment { pub fn new( ident: Ident, - id: Option<NodeId>, hir_id: Option<HirId>, def: Option<Def>, args: GenericArgs, @@ -368,7 +365,6 @@ impl PathSegment { ) -> Self { PathSegment { ident, - id, hir_id, def, infer_types, diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index 0803816fb03..ff9206820ac 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -171,7 +171,6 @@ impl_stable_hash_for!(struct hir::Path { impl_stable_hash_for!(struct hir::PathSegment { ident -> (ident.name), - id, hir_id, def, infer_types, diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index d39f516ee11..29f8c30e33e 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -4250,7 +4250,6 @@ where F: Fn(DefId) -> Def { def: def_ctor(def_id), segments: hir::HirVec::from_vec(apb.names.iter().map(|s| hir::PathSegment { ident: ast::Ident::from_str(&s), - id: None, hir_id: None, def: None, args: None, diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index eb131bf6cd1..8fe116bd9c8 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -191,7 +191,6 @@ impl<'a, 'tcx, 'rcx> DocContext<'a, 'tcx, 'rcx> { real_name.unwrap_or(last.ident), None, None, - None, self.generics_to_path_params(generics.clone()), false, )); |
