@@ -99,12 +99,32 @@ private ItemNode getAChildSuccessor(ItemNode item, string name, SuccessorKind ki
99
99
* For example, if we have
100
100
*
101
101
* ```rust
102
- * mod m1 {
103
- * mod m2 { }
102
+ * pub mod m1 {
103
+ * pub mod m2 { }
104
+ * }
105
+ * ```
106
+ *
107
+ * then there is an edge `mod m1 --m2,both--> mod m2`.
108
+ *
109
+ * Associated items are example of externally visible items (inside the
110
+ * declaring item they must be `Self` prefixed), while type parameters are
111
+ * examples of internally visible items. For example, for
112
+ *
113
+ * ```rust
114
+ * mod m {
115
+ * pub trait<T> Trait {
116
+ * fn foo(&self) -> T;
117
+ * }
104
118
* }
105
119
* ```
106
120
*
107
- * then there is an edge `m1 --m2,both--> m1::m2`.
121
+ * we have the following edges
122
+ *
123
+ * ```
124
+ * mod m --Trait,both--> trait Trait
125
+ * trait Trait --foo,external --> fn foo
126
+ * trait Trait --T,internal --> T
127
+ * ```
108
128
*
109
129
* Source files are also considered nodes in the item graph, and for
110
130
* each source file `f` there is an edge `f --name,both--> item` when `f`
@@ -119,13 +139,13 @@ private ItemNode getAChildSuccessor(ItemNode item, string name, SuccessorKind ki
119
139
* }
120
140
* ```
121
141
*
122
- * we first generate an edge `m1:: m2 --name,kind--> f::item`, where `item` is
142
+ * we first generate an edge `mod m2 --name,kind--> f::item`, where `item` is
123
143
* any item (named `name`) inside the imported source file `f`, and `kind` is
124
144
* either `external` or `both`. Using this edge, `m2::foo` can resolve to
125
- * `f::foo`, which results in the edge `m1:: use m2 --foo,internal--> f::foo`
145
+ * `f::foo`, which results in the edge `use m2 --foo,internal--> f::foo`
126
146
* (would have been `external` if it was `pub use m2::foo`). Lastly, all edges
127
147
* out of `use` nodes are lifted to predecessors in the graph, so we get
128
- * an edge `m1 --foo,internal--> f::foo`.
148
+ * an edge `mod m1 --foo,internal--> f::foo`.
129
149
*
130
150
*
131
151
* References:
0 commit comments