Skip to content

Commit 3d1ecc5

Browse files
committed
Normalize generic bounds in graph iterators
Use where clasues and only where clauses for bounds in the iterators for Graph. The rest of the code uses bounds on the generic declarations for Debug, and we may want to change those to for consistency. I did not do that here because I don't know whether or not that's a good idea. But for the iterators, they were inconsistent causing confusion, at least for me.
1 parent ea4b94d commit 3d1ecc5

File tree

1 file changed

+6
-3
lines changed
  • src/librustc_data_structures/graph

1 file changed

+6
-3
lines changed

src/librustc_data_structures/graph/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ impl<'g, N: Debug, E: Debug> Iterator for AdjacentEdges<'g, N, E> {
336336
}
337337
}
338338

339-
pub struct AdjacentTargets<'g, N: 'g, E: 'g>
339+
pub struct AdjacentTargets<'g, N, E>
340340
where N: 'g,
341341
E: 'g
342342
{
@@ -351,7 +351,7 @@ impl<'g, N: Debug, E: Debug> Iterator for AdjacentTargets<'g, N, E> {
351351
}
352352
}
353353

354-
pub struct AdjacentSources<'g, N: 'g, E: 'g>
354+
pub struct AdjacentSources<'g, N, E>
355355
where N: 'g,
356356
E: 'g
357357
{
@@ -366,7 +366,10 @@ impl<'g, N: Debug, E: Debug> Iterator for AdjacentSources<'g, N, E> {
366366
}
367367
}
368368

369-
pub struct DepthFirstTraversal<'g, N: 'g, E: 'g> {
369+
pub struct DepthFirstTraversal<'g, N, E>
370+
where N: 'g,
371+
E: 'g
372+
{
370373
graph: &'g Graph<N, E>,
371374
stack: Vec<NodeIndex>,
372375
visited: BitVector,

0 commit comments

Comments
 (0)