提交 78f91e39 编写于 作者: L ljedrz

hir: remove NodeId from PathSegment

上级 cd06038b
...@@ -1932,7 +1932,6 @@ fn lower_path_segment( ...@@ -1932,7 +1932,6 @@ fn lower_path_segment(
hir::PathSegment::new( hir::PathSegment::new(
segment.ident, segment.ident,
Some(id.node_id),
Some(id.hir_id), Some(id.hir_id),
Some(def), Some(def),
generic_args, generic_args,
...@@ -3276,10 +3275,8 @@ fn renumber_segment_ids(&mut self, path: &P<hir::Path>) -> P<hir::Path> { ...@@ -3276,10 +3275,8 @@ fn renumber_segment_ids(&mut self, path: &P<hir::Path>) -> P<hir::Path> {
debug!("renumber_segment_ids(path = {:?})", path); debug!("renumber_segment_ids(path = {:?})", path);
let mut path = path.clone(); let mut path = path.clone();
for seg in path.segments.iter_mut() { for seg in path.segments.iter_mut() {
if seg.id.is_some() { if seg.hir_id.is_some() {
let next_id = self.next_id(); seg.hir_id = Some(self.next_id().hir_id);
seg.id = Some(next_id.node_id);
seg.hir_id = Some(next_id.hir_id);
} }
} }
path path
...@@ -5024,8 +5021,8 @@ fn std_path( ...@@ -5024,8 +5021,8 @@ fn std_path(
for seg in path.segments.iter_mut() { for seg in path.segments.iter_mut() {
if let Some(id) = seg.id { if seg.hir_id.is_some() {
seg.id = Some(self.lower_node_id(id).node_id); seg.hir_id = Some(self.next_id().hir_id);
} }
} }
path path
......
...@@ -327,7 +327,6 @@ pub struct PathSegment { ...@@ -327,7 +327,6 @@ pub struct PathSegment {
// therefore will not have 'jump to def' in IDEs, but otherwise will not be // 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 // affected. (In general, we don't bother to get the defs for synthesized
// segments, only for segments which have come from the AST). // segments, only for segments which have come from the AST).
pub id: Option<NodeId>,
pub hir_id: Option<HirId>, pub hir_id: Option<HirId>,
pub def: Option<Def>, pub def: Option<Def>,
...@@ -350,7 +349,6 @@ impl PathSegment { ...@@ -350,7 +349,6 @@ impl PathSegment {
pub fn from_ident(ident: Ident) -> PathSegment { pub fn from_ident(ident: Ident) -> PathSegment {
PathSegment { PathSegment {
ident, ident,
id: None,
hir_id: None, hir_id: None,
def: None, def: None,
infer_types: true, infer_types: true,
...@@ -360,7 +358,6 @@ pub fn from_ident(ident: Ident) -> PathSegment { ...@@ -360,7 +358,6 @@ pub fn from_ident(ident: Ident) -> PathSegment {
pub fn new( pub fn new(
ident: Ident, ident: Ident,
id: Option<NodeId>,
hir_id: Option<HirId>, hir_id: Option<HirId>,
def: Option<Def>, def: Option<Def>,
args: GenericArgs, args: GenericArgs,
...@@ -368,7 +365,6 @@ pub fn new( ...@@ -368,7 +365,6 @@ pub fn new(
) -> Self { ) -> Self {
PathSegment { PathSegment {
ident, ident,
id,
hir_id, hir_id,
def, def,
infer_types, infer_types,
......
...@@ -171,7 +171,6 @@ fn hash_stable<W: StableHasherResult>(&self, ...@@ -171,7 +171,6 @@ fn hash_stable<W: StableHasherResult>(&self,
impl_stable_hash_for!(struct hir::PathSegment { impl_stable_hash_for!(struct hir::PathSegment {
ident -> (ident.name), ident -> (ident.name),
id,
hir_id, hir_id,
def, def,
infer_types, infer_types,
......
...@@ -4250,7 +4250,6 @@ fn push(&mut self, text: &str) { ...@@ -4250,7 +4250,6 @@ fn push(&mut self, text: &str) {
def: def_ctor(def_id), def: def_ctor(def_id),
segments: hir::HirVec::from_vec(apb.names.iter().map(|s| hir::PathSegment { segments: hir::HirVec::from_vec(apb.names.iter().map(|s| hir::PathSegment {
ident: ast::Ident::from_str(&s), ident: ast::Ident::from_str(&s),
id: None,
hir_id: None, hir_id: None,
def: None, def: None,
args: None, args: None,
......
...@@ -191,7 +191,6 @@ pub fn get_real_ty<F>(&self, ...@@ -191,7 +191,6 @@ pub fn get_real_ty<F>(&self,
real_name.unwrap_or(last.ident), real_name.unwrap_or(last.ident),
None, None,
None, None,
None,
self.generics_to_path_params(generics.clone()), self.generics_to_path_params(generics.clone()),
false, false,
)); ));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册