diff options
| author | bors <bors@rust-lang.org> | 2023-02-22 02:39:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-02-22 02:39:09 +0000 |
| commit | f9216b75646cde0c4c69ae00232778a47fc893d3 (patch) | |
| tree | 17f92fa0faec4c81769be4cf6e57a074a70829b3 /compiler/rustc_data_structures/src | |
| parent | 375d5ace705f8494af06b545291d64486fbada06 (diff) | |
| parent | d39fc2111bd16f78d7ad79c06ce1eb774a4bfa2e (diff) | |
| download | rust-f9216b75646cde0c4c69ae00232778a47fc893d3.tar.gz rust-f9216b75646cde0c4c69ae00232778a47fc893d3.zip | |
Auto merge of #108325 - matthiaskrgr:rollup-73qihie, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #104239 (Better debug logs for borrowck constraint graph) - #108202 (Make sure `test_type_match` doesn't ICE with late-bound types) - #108295 (Use DefKind to give more item kind information during BindingObligation note ) - #108306 (compiletest: up deps) - #108313 (Fix compiletest possible crash in option only-modified) - #108322 (Clean ConstProp) - #108323 (hir-analysis: make one diagnostic translatable) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/graph/scc/mod.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/graph/scc/mod.rs b/compiler/rustc_data_structures/src/graph/scc/mod.rs index c8e66eb672c..c4b11951ab7 100644 --- a/compiler/rustc_data_structures/src/graph/scc/mod.rs +++ b/compiler/rustc_data_structures/src/graph/scc/mod.rs @@ -27,7 +27,7 @@ pub struct Sccs<N: Idx, S: Idx> { scc_data: SccData<S>, } -struct SccData<S: Idx> { +pub struct SccData<S: Idx> { /// For each SCC, the range of `all_successors` where its /// successors can be found. ranges: IndexVec<S, Range<usize>>, @@ -43,6 +43,14 @@ impl<N: Idx, S: Idx + Ord> Sccs<N, S> { SccsConstruction::construct(graph) } + pub fn scc_indices(&self) -> &IndexVec<N, S> { + &self.scc_indices + } + + pub fn scc_data(&self) -> &SccData<S> { + &self.scc_data + } + /// Returns the number of SCCs in the graph. pub fn num_sccs(&self) -> usize { self.scc_data.len() @@ -115,6 +123,14 @@ impl<S: Idx> SccData<S> { self.ranges.len() } + pub fn ranges(&self) -> &IndexVec<S, Range<usize>> { + &self.ranges + } + + pub fn all_successors(&self) -> &Vec<S> { + &self.all_successors + } + /// Returns the successors of the given SCC. fn successors(&self, scc: S) -> &[S] { // Annoyingly, `range` does not implement `Copy`, so we have |
