Skip to content

Commit 78f91e3

Browse files
committed
hir: remove NodeId from PathSegment
1 parent cd06038 commit 78f91e3

File tree

5 files changed

+4
-14
lines changed

5 files changed

+4
-14
lines changed

src/librustc/hir/lowering.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -1932,7 +1932,6 @@ impl<'a> LoweringContext<'a> {
19321932

19331933
hir::PathSegment::new(
19341934
segment.ident,
1935-
Some(id.node_id),
19361935
Some(id.hir_id),
19371936
Some(def),
19381937
generic_args,
@@ -3276,10 +3275,8 @@ impl<'a> LoweringContext<'a> {
32763275
debug!("renumber_segment_ids(path = {:?})", path);
32773276
let mut path = path.clone();
32783277
for seg in path.segments.iter_mut() {
3279-
if seg.id.is_some() {
3280-
let next_id = self.next_id();
3281-
seg.id = Some(next_id.node_id);
3282-
seg.hir_id = Some(next_id.hir_id);
3278+
if seg.hir_id.is_some() {
3279+
seg.hir_id = Some(self.next_id().hir_id);
32833280
}
32843281
}
32853282
path
@@ -5024,8 +5021,8 @@ impl<'a> LoweringContext<'a> {
50245021

50255022

50265023
for seg in path.segments.iter_mut() {
5027-
if let Some(id) = seg.id {
5028-
seg.id = Some(self.lower_node_id(id).node_id);
5024+
if seg.hir_id.is_some() {
5025+
seg.hir_id = Some(self.next_id().hir_id);
50295026
}
50305027
}
50315028
path

src/librustc/hir/mod.rs

-4
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ pub struct PathSegment {
327327
// therefore will not have 'jump to def' in IDEs, but otherwise will not be
328328
// affected. (In general, we don't bother to get the defs for synthesized
329329
// segments, only for segments which have come from the AST).
330-
pub id: Option<NodeId>,
331330
pub hir_id: Option<HirId>,
332331
pub def: Option<Def>,
333332

@@ -350,7 +349,6 @@ impl PathSegment {
350349
pub fn from_ident(ident: Ident) -> PathSegment {
351350
PathSegment {
352351
ident,
353-
id: None,
354352
hir_id: None,
355353
def: None,
356354
infer_types: true,
@@ -360,15 +358,13 @@ impl PathSegment {
360358

361359
pub fn new(
362360
ident: Ident,
363-
id: Option<NodeId>,
364361
hir_id: Option<HirId>,
365362
def: Option<Def>,
366363
args: GenericArgs,
367364
infer_types: bool,
368365
) -> Self {
369366
PathSegment {
370367
ident,
371-
id,
372368
hir_id,
373369
def,
374370
infer_types,

src/librustc/ich/impls_hir.rs

-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ impl_stable_hash_for!(struct hir::Path {
171171

172172
impl_stable_hash_for!(struct hir::PathSegment {
173173
ident -> (ident.name),
174-
id,
175174
hir_id,
176175
def,
177176
infer_types,

src/librustdoc/clean/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4250,7 +4250,6 @@ where F: Fn(DefId) -> Def {
42504250
def: def_ctor(def_id),
42514251
segments: hir::HirVec::from_vec(apb.names.iter().map(|s| hir::PathSegment {
42524252
ident: ast::Ident::from_str(&s),
4253-
id: None,
42544253
hir_id: None,
42554254
def: None,
42564255
args: None,

src/librustdoc/core.rs

-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ impl<'a, 'tcx, 'rcx> DocContext<'a, 'tcx, 'rcx> {
191191
real_name.unwrap_or(last.ident),
192192
None,
193193
None,
194-
None,
195194
self.generics_to_path_params(generics.clone()),
196195
false,
197196
));

0 commit comments

Comments
 (0)