File tree Expand file tree Collapse file tree
compiler/rustc_middle/src/dep_graph Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1222,13 +1222,14 @@ pub struct TaskDeps {
12221222 #[ cfg( debug_assertions) ]
12231223 node : Option < DepNode > ,
12241224
1225- /// A vector of `DepNodeIndex`, basically.
1225+ /// A vector of `DepNodeIndex`, basically. Contains no duplicates.
12261226 reads : EdgesVec ,
12271227
1228- /// When adding new edges to `reads` in `DepGraph::read_index` we need to determine if the edge
1229- /// has been seen before. If the number of elements in `reads` is small, we just do a linear
1230- /// scan. If the number is higher, a hashset has better perf. This field is that hashset. It's
1231- /// only used if the number of elements in `reads` exceeds `LINEAR_SCAN_MAX`.
1228+ /// When adding a new edge to `reads` in `DepGraph::read_index` we must determine if the edge
1229+ /// has been seen before. We just do a linear scan of `reads` if its length is less than or
1230+ /// equal to `LINEAR_SCAN_MAX`. Otherwise, we use this hashset for better performance. Note:
1231+ /// `reads` is always the canonical edges representation; this field is just to speed up the
1232+ /// seen-before test.
12321233 read_set : FxHashSet < DepNodeIndex > ,
12331234}
12341235
You can’t perform that action at this time.
0 commit comments