summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_data_structures/src/graph/scc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /compiler/rustc_data_structures/src/graph/scc
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_data_structures/src/graph/scc')
-rw-r--r--compiler/rustc_data_structures/src/graph/scc/mod.rs6
-rw-r--r--compiler/rustc_data_structures/src/graph/scc/tests.rs6
2 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_data_structures/src/graph/scc/mod.rs b/compiler/rustc_data_structures/src/graph/scc/mod.rs
index c4b11951a..28c357e54 100644
--- a/compiler/rustc_data_structures/src/graph/scc/mod.rs
+++ b/compiler/rustc_data_structures/src/graph/scc/mod.rs
@@ -8,7 +8,7 @@
use crate::fx::FxHashSet;
use crate::graph::vec_graph::VecGraph;
use crate::graph::{DirectedGraph, GraphSuccessors, WithNumEdges, WithNumNodes, WithSuccessors};
-use rustc_index::vec::{Idx, IndexVec};
+use rustc_index::vec::{Idx, IndexSlice, IndexVec};
use std::ops::Range;
#[cfg(test)]
@@ -43,7 +43,7 @@ impl<N: Idx, S: Idx + Ord> Sccs<N, S> {
SccsConstruction::construct(graph)
}
- pub fn scc_indices(&self) -> &IndexVec<N, S> {
+ pub fn scc_indices(&self) -> &IndexSlice<N, S> {
&self.scc_indices
}
@@ -123,7 +123,7 @@ impl<S: Idx> SccData<S> {
self.ranges.len()
}
- pub fn ranges(&self) -> &IndexVec<S, Range<usize>> {
+ pub fn ranges(&self) -> &IndexSlice<S, Range<usize>> {
&self.ranges
}
diff --git a/compiler/rustc_data_structures/src/graph/scc/tests.rs b/compiler/rustc_data_structures/src/graph/scc/tests.rs
index 820a70fc8..513df666d 100644
--- a/compiler/rustc_data_structures/src/graph/scc/tests.rs
+++ b/compiler/rustc_data_structures/src/graph/scc/tests.rs
@@ -56,7 +56,7 @@ fn test_three_sccs() {
assert_eq!(sccs.scc(1), 0);
assert_eq!(sccs.scc(2), 0);
assert_eq!(sccs.scc(3), 2);
- assert_eq!(sccs.successors(0), &[]);
+ assert_eq!(sccs.successors(0), &[] as &[usize]);
assert_eq!(sccs.successors(1), &[0]);
assert_eq!(sccs.successors(2), &[0]);
}
@@ -113,7 +113,7 @@ fn test_find_state_2() {
assert_eq!(sccs.scc(2), 0);
assert_eq!(sccs.scc(3), 0);
assert_eq!(sccs.scc(4), 0);
- assert_eq!(sccs.successors(0), &[]);
+ assert_eq!(sccs.successors(0), &[] as &[usize]);
}
#[test]
@@ -138,7 +138,7 @@ fn test_find_state_3() {
assert_eq!(sccs.scc(3), 0);
assert_eq!(sccs.scc(4), 0);
assert_eq!(sccs.scc(5), 1);
- assert_eq!(sccs.successors(0), &[]);
+ assert_eq!(sccs.successors(0), &[] as &[usize]);
assert_eq!(sccs.successors(1), &[0]);
}