File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -90,11 +90,16 @@ impl ItemCanonicalPath for ItemId {
90
90
pub struct Item {
91
91
/// This item's id.
92
92
id : ItemId ,
93
+
93
94
/// The item's local id, unique only amongst its siblings. Only used for
94
95
/// anonymous items.
95
96
///
96
97
/// Lazily initialized in local_id().
98
+ ///
99
+ /// Note that only structs, unions, and enums get a local type id. In any
100
+ /// case this is an implementation detail.
97
101
local_id : Cell < Option < usize > > ,
102
+
98
103
/// The next local id to use for a child..
99
104
next_child_local_id : Cell < usize > ,
100
105
@@ -519,6 +524,10 @@ impl Item {
519
524
_ => { }
520
525
}
521
526
}
527
+
528
+ // Note that this `id_` prefix prevents (really unlikely) collisions
529
+ // between the global id and the local id of an item with the same
530
+ // parent.
522
531
format ! ( "id_{}" , self . id( ) . 0 )
523
532
}
524
533
You can’t perform that action at this time.
0 commit comments