Skip to content

Commit f514493

Browse files
committed
Rename WithNumEdges => NumEdges and WithStartNode => StartNode
1 parent 0d5fc9b commit f514493

9 files changed

Lines changed: 21 additions & 21 deletions

File tree

‎compiler/rustc_data_structures/src/graph/iterate/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
usesuper::{DirectedGraph,Successors,WithStartNode};
1+
usesuper::{DirectedGraph,StartNode,Successors};
22
use rustc_index::bit_set::BitSet;
33
use rustc_index::{IndexSlice,IndexVec};
44
use std::ops::ControlFlow;
@@ -278,7 +278,7 @@ where
278278

279279
impl<G>TriColorDepthFirstSearch<'_,G>
280280
where
281-
G: ?Sized + DirectedGraph + Successors + WithStartNode,
281+
G: ?Sized + DirectedGraph + Successors + StartNode,
282282
{
283283
/// Performs a depth-first search, starting from `G::start_node()`.
284284
///

‎compiler/rustc_data_structures/src/graph/mod.rs‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ pub trait DirectedGraph {
1616
fnnum_nodes(&self) -> usize;
1717
}
1818

19-
pubtraitWithNumEdges:DirectedGraph{
19+
pubtraitNumEdges:DirectedGraph{
2020
fnnum_edges(&self) -> usize;
2121
}
2222

23+
pubtraitStartNode:DirectedGraph{
24+
fnstart_node(&self) -> Self::Node;
25+
}
26+
2327
pubtraitSuccessors:DirectedGraph{
2428
typeSuccessors<'g>:Iterator<Item = Self::Node>
2529
where
@@ -40,20 +44,16 @@ pub trait Predecessors: DirectedGraph {
4044
fnpredecessors(&self,node:Self::Node) -> Self::Predecessors<'_>;
4145
}
4246

43-
pubtraitWithStartNode:DirectedGraph{
44-
fnstart_node(&self) -> Self::Node;
45-
}
46-
47-
pubtraitControlFlowGraph:DirectedGraph + WithStartNode + Predecessors + Successors{
47+
pubtraitControlFlowGraph:DirectedGraph + StartNode + Predecessors + Successors{
4848
// convenient trait
4949
}
5050

51-
impl<T>ControlFlowGraphforTwhereT:DirectedGraph + WithStartNode + Predecessors + Successors{}
51+
impl<T>ControlFlowGraphforTwhereT:DirectedGraph + StartNode + Predecessors + Successors{}
5252

5353
/// Returns `true` if the graph has a cycle that is reachable from the start node.
5454
pubfnis_cyclic<G>(graph:&G) -> bool
5555
where
56-
G: ?Sized + DirectedGraph + WithStartNode + Successors,
56+
G: ?Sized + DirectedGraph + StartNode + Successors,
5757
{
5858
iterate::TriColorDepthFirstSearch::new(graph)
5959
.run_from_start(&mut iterate::CycleDetector)

‎compiler/rustc_data_structures/src/graph/reference.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ impl<'graph, G: DirectedGraph> DirectedGraph for &'graph G {
88
}
99
}
1010

11-
impl<'graph,G:WithStartNode>WithStartNodefor&'graphG{
11+
impl<'graph,G:StartNode>StartNodefor&'graphG{
1212
fnstart_node(&self) -> Self::Node{
1313
(**self).start_node()
1414
}

‎compiler/rustc_data_structures/src/graph/scc/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
usecrate::fx::FxHashSet;
99
usecrate::graph::vec_graph::VecGraph;
10-
usecrate::graph::{DirectedGraph,Successors,WithNumEdges};
10+
usecrate::graph::{DirectedGraph,NumEdges,Successors};
1111
use rustc_index::{Idx,IndexSlice,IndexVec};
1212
use std::ops::Range;
1313

@@ -97,7 +97,7 @@ impl<N: Idx, S: Idx + Ord> DirectedGraph for Sccs<N, S> {
9797
}
9898
}
9999

100-
impl<N:Idx,S:Idx + Ord>WithNumEdgesforSccs<N,S>{
100+
impl<N:Idx,S:Idx + Ord>NumEdgesforSccs<N,S>{
101101
fnnum_edges(&self) -> usize{
102102
self.scc_data.all_successors.len()
103103
}

‎compiler/rustc_data_structures/src/graph/tests.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl DirectedGraph for TestGraph {
4242
}
4343
}
4444

45-
implWithStartNodeforTestGraph{
45+
implStartNodeforTestGraph{
4646
fnstart_node(&self) -> usize{
4747
self.start_node
4848
}

‎compiler/rustc_data_structures/src/graph/vec_graph/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
usecrate::graph::{DirectedGraph,Successors,WithNumEdges};
1+
usecrate::graph::{DirectedGraph,NumEdges,Successors};
22
use rustc_index::{Idx,IndexVec};
33

44
#[cfg(test)]
@@ -86,7 +86,7 @@ impl<N: Idx> DirectedGraph for VecGraph<N> {
8686
}
8787
}
8888

89-
impl<N:Idx>WithNumEdgesforVecGraph<N>{
89+
impl<N:Idx>NumEdgesforVecGraph<N>{
9090
fnnum_edges(&self) -> usize{
9191
self.edge_targets.len()
9292
}

‎compiler/rustc_middle/src/mir/basic_blocks.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl<'tcx> graph::DirectedGraph for BasicBlocks<'tcx> {
148148
}
149149
}
150150

151-
impl<'tcx> graph::WithStartNodeforBasicBlocks<'tcx>{
151+
impl<'tcx> graph::StartNodeforBasicBlocks<'tcx>{
152152
#[inline]
153153
fnstart_node(&self) -> Self::Node{
154154
START_BLOCK

‎compiler/rustc_middle/src/mir/generic_graphviz.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::io::{self, Write};
55

66
pubstructGraphvizWriter<
77
'a,
8-
G: graph::DirectedGraph + graph::Successors + graph::WithStartNode,
8+
G: graph::DirectedGraph + graph::Successors + graph::StartNode,
99
NodeContentFn:Fn(<Gas graph::DirectedGraph>::Node) -> Vec<String>,
1010
EdgeLabelsFn:Fn(<Gas graph::DirectedGraph>::Node) -> Vec<String>,
1111
>{
@@ -19,7 +19,7 @@ pub struct GraphvizWriter<
1919

2020
impl<
2121
'a,
22-
G: graph::DirectedGraph + graph::Successors + graph::WithStartNode,
22+
G: graph::DirectedGraph + graph::Successors + graph::StartNode,
2323
NodeContentFn:Fn(<Gas graph::DirectedGraph>::Node) -> Vec<String>,
2424
EdgeLabelsFn:Fn(<Gas graph::DirectedGraph>::Node) -> Vec<String>,
2525
>GraphvizWriter<'a,G,NodeContentFn,EdgeLabelsFn>

‎compiler/rustc_mir_transform/src/coverage/graph.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc_data_structures::captures::Captures;
22
use rustc_data_structures::fx::FxHashSet;
33
use rustc_data_structures::graph::dominators::{self,Dominators};
4-
use rustc_data_structures::graph::{self,DirectedGraph,WithStartNode};
4+
use rustc_data_structures::graph::{self,DirectedGraph,StartNode};
55
use rustc_index::bit_set::BitSet;
66
use rustc_index::IndexVec;
77
use rustc_middle::mir::{self,BasicBlock,Terminator,TerminatorKind};
@@ -200,7 +200,7 @@ impl graph::DirectedGraph for CoverageGraph {
200200
}
201201
}
202202

203-
impl graph::WithStartNodeforCoverageGraph{
203+
impl graph::StartNodeforCoverageGraph{
204204
#[inline]
205205
fnstart_node(&self) -> Self::Node{
206206
self.bcb_from_bb(mir::START_BLOCK)

0 commit comments

Comments
 (0)