1
Fork 0

Split {Idx, IndexVec, IndexSlice} into their own modules

This commit is contained in:
Maybe Waffle 2023-04-19 10:57:17 +00:00
parent 64bcb32651
commit e496fbec92
150 changed files with 472 additions and 454 deletions

View file

@ -1,4 +1,4 @@
use rustc_index::vec::{Idx, IndexVec};
use rustc_index::{Idx, IndexVec};
use std::{mem, rc::Rc, sync::Arc};
pub trait IdFunctor: Sized {

View file

@ -10,7 +10,8 @@
//! <https://www.cs.princeton.edu/courses/archive/spr03/cs423/download/dominators.pdf>
use super::ControlFlowGraph;
use rustc_index::vec::{Idx, IndexSlice, IndexVec};
use rustc_index::{Idx, IndexSlice, IndexVec};
use std::cmp::Ordering;
#[cfg(test)]

View file

@ -1,6 +1,6 @@
use super::{DirectedGraph, WithNumNodes, WithStartNode, WithSuccessors};
use rustc_index::bit_set::BitSet;
use rustc_index::vec::{IndexSlice, IndexVec};
use rustc_index::{IndexSlice, IndexVec};
use std::ops::ControlFlow;
#[cfg(test)]

View file

@ -1,4 +1,4 @@
use rustc_index::vec::Idx;
use rustc_index::Idx;
pub mod dominators;
pub mod implementation;

View file

@ -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, IndexSlice, IndexVec};
use rustc_index::{Idx, IndexSlice, IndexVec};
use std::ops::Range;
#[cfg(test)]

View file

@ -1,5 +1,5 @@
use crate::graph::{DirectedGraph, GraphSuccessors, WithNumEdges, WithNumNodes, WithSuccessors};
use rustc_index::vec::{Idx, IndexVec};
use rustc_index::{Idx, IndexVec};
#[cfg(test)]
mod tests;

View file

@ -3,7 +3,7 @@
use std::hash::{Hash, Hasher};
use crate::stable_hasher::{HashStable, StableHasher};
use rustc_index::vec::{Idx, IndexVec};
use rustc_index::{Idx, IndexVec};
/// An indexed multi-map that preserves insertion order while permitting both *O*(log *n*) lookup of
/// an item by key and *O*(1) lookup by index.

View file

@ -1,6 +1,6 @@
use crate::sip128::SipHasher128;
use rustc_index::bit_set;
use rustc_index::vec;
use rustc_index::bit_set::{self, BitSet};
use rustc_index::{Idx, IndexVec};
use smallvec::SmallVec;
use std::fmt;
use std::hash::{BuildHasher, Hash, Hasher};
@ -557,7 +557,7 @@ where
}
}
impl<I: vec::Idx, T, CTX> HashStable<CTX> for vec::IndexVec<I, T>
impl<I: Idx, T, CTX> HashStable<CTX> for IndexVec<I, T>
where
T: HashStable<CTX>,
{
@ -569,13 +569,13 @@ where
}
}
impl<I: vec::Idx, CTX> HashStable<CTX> for bit_set::BitSet<I> {
impl<I: Idx, CTX> HashStable<CTX> for BitSet<I> {
fn hash_stable(&self, _ctx: &mut CTX, hasher: &mut StableHasher) {
::std::hash::Hash::hash(self, hasher);
}
}
impl<R: vec::Idx, C: vec::Idx, CTX> HashStable<CTX> for bit_set::BitMatrix<R, C> {
impl<R: Idx, C: Idx, CTX> HashStable<CTX> for bit_set::BitMatrix<R, C> {
fn hash_stable(&self, _ctx: &mut CTX, hasher: &mut StableHasher) {
::std::hash::Hash::hash(self, hasher);
}

View file

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use rustc_index::vec::Idx;
use rustc_index::Idx;
#[derive(Default)]
pub struct AppendOnlyIndexVec<I: Idx, T: Copy> {

View file

@ -1,4 +1,4 @@
use rustc_index::vec::{Idx, IndexVec};
use rustc_index::{Idx, IndexVec};
pub fn iter<Ls>(
first: Option<Ls::LinkIndex>,

View file

@ -1,5 +1,5 @@
use rustc_index::bit_set::BitSet;
use rustc_index::vec::Idx;
use rustc_index::Idx;
use std::collections::VecDeque;
/// A work queue is a handy data structure for tracking work left to