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 @@ -97,11 +97,16 @@ impl ItemCanonicalPath for ItemId {
97
97
pub struct Item {
98
98
/// This item's id.
99
99
id : ItemId ,
100
+
100
101
/// The item's local id, unique only amongst its siblings. Only used for
101
102
/// anonymous items.
102
103
///
103
104
/// Lazily initialized in local_id().
105
+ ///
106
+ /// Note that only structs, unions, and enums get a local type id. In any
107
+ /// case this is an implementation detail.
104
108
local_id : Cell < Option < usize > > ,
109
+
105
110
/// The next local id to use for a child..
106
111
next_child_local_id : Cell < usize > ,
107
112
@@ -546,6 +551,10 @@ impl Item {
546
551
_ => { }
547
552
}
548
553
}
554
+
555
+ // Note that this `id_` prefix prevents (really unlikely) collisions
556
+ // between the global id and the local id of an item with the same
557
+ // parent.
549
558
format ! ( "id_{}" , self . id( ) . 0 )
550
559
}
551
560
You can’t perform that action at this time.
0 commit comments