diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2024-04-15 13:33:08 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2024-04-15 13:34:08 +0000 |
| commit | 435db9b9bd404c1bc632fbb6ade8b4ce92c2828c (patch) | |
| tree | a203fe3f701723487e869937d0446d11bb13779c /compiler/rustc_data_structures/src/graph/vec_graph | |
| parent | e8d2221e3bbb4e8971c97395463036ebd6e7b23d (diff) | |
| download | rust-435db9b9bd404c1bc632fbb6ade8b4ce92c2828c.tar.gz rust-435db9b9bd404c1bc632fbb6ade8b4ce92c2828c.zip | |
Use RPITIT for `Successors` and `Predecessors` traits
Now with RPITIT instead of GAT!
Diffstat (limited to 'compiler/rustc_data_structures/src/graph/vec_graph')
| -rw-r--r-- | compiler/rustc_data_structures/src/graph/vec_graph/mod.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_data_structures/src/graph/vec_graph/mod.rs b/compiler/rustc_data_structures/src/graph/vec_graph/mod.rs index 3f9d8ec0aca..26c86469fad 100644 --- a/compiler/rustc_data_structures/src/graph/vec_graph/mod.rs +++ b/compiler/rustc_data_structures/src/graph/vec_graph/mod.rs @@ -93,9 +93,7 @@ impl<N: Idx> NumEdges for VecGraph<N> { } impl<N: Idx + Ord> Successors for VecGraph<N> { - type Successors<'g> = std::iter::Cloned<std::slice::Iter<'g, N>>; - - fn successors(&self, node: N) -> Self::Successors<'_> { + fn successors(&self, node: N) -> impl Iterator<Item = Self::Node> { self.successors(node).iter().cloned() } } |
