diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2016-05-25 15:55:46 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2016-05-25 15:55:46 +0200 |
| commit | df5c116250657daa98da84eebe1b44a495abf5c0 (patch) | |
| tree | fed43a95b8ed402fa343acd8f2a7c5f4cebe13b0 | |
| parent | ad0e6adbb1453d7e0abe6d3f279b005036d4faa3 (diff) | |
| download | rust-df5c116250657daa98da84eebe1b44a495abf5c0.tar.gz rust-df5c116250657daa98da84eebe1b44a495abf5c0.zip | |
Alpha rename `OwnIdxSet` to `IdxSetBuf`.
| -rw-r--r-- | src/librustc_borrowck/borrowck/mir/dataflow/mod.rs | 14 | ||||
| -rw-r--r-- | src/librustc_borrowck/indexed_set.rs | 22 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/librustc_borrowck/borrowck/mir/dataflow/mod.rs b/src/librustc_borrowck/borrowck/mir/dataflow/mod.rs index da7a85c1a8a..b46b6c368a0 100644 --- a/src/librustc_borrowck/borrowck/mir/dataflow/mod.rs +++ b/src/librustc_borrowck/borrowck/mir/dataflow/mod.rs @@ -21,7 +21,7 @@ use super::MirBorrowckCtxtPreDataflow; use super::MoveDataParamEnv; use bitslice::{bitwise, BitwiseOperator}; -use indexed_set::{Idx, IdxSet, OwnIdxSet}; +use indexed_set::{Idx, IdxSet, IdxSetBuf}; pub use self::sanity_check::sanity_check_via_rustc_peek; pub use self::impls::{MaybeInitializedLvals, MaybeUninitializedLvals}; @@ -57,7 +57,7 @@ impl<'a, 'tcx: 'a, BD> DataflowAnalysis<'a, 'tcx, BD> where BD: BitDenotation + DataflowOperator { fn propagate(&mut self) { - let mut temp = OwnIdxSet::new_empty(self.flow_state.sets.bits_per_block); + let mut temp = IdxSetBuf::new_empty(self.flow_state.sets.bits_per_block); let mut propcx = PropagationContext { builder: self, changed: true, @@ -167,7 +167,7 @@ impl<'a, 'tcx: 'a, BD> MirBorrowckCtxtPreDataflow<'a, 'tcx, BD> /// Maps each block to a set of bits #[derive(Debug)] struct Bits<E:Idx> { - bits: OwnIdxSet<E>, + bits: IdxSetBuf<E>, } impl<E:Idx> Clone for Bits<E> { @@ -175,7 +175,7 @@ impl<E:Idx> Clone for Bits<E> { } impl<E:Idx> Bits<E> { - fn new(bits: OwnIdxSet<E>) -> Self { + fn new(bits: IdxSetBuf<E>) -> Self { Bits { bits: bits } } } @@ -393,11 +393,11 @@ impl<'a, 'tcx: 'a, D> DataflowAnalysis<'a, 'tcx, D> let num_blocks = mir.basic_blocks.len(); let num_overall = num_blocks * bits_per_block; - let zeroes = Bits::new(OwnIdxSet::new_empty(num_overall)); + let zeroes = Bits::new(IdxSetBuf::new_empty(num_overall)); let on_entry = Bits::new(if D::bottom_value() { - OwnIdxSet::new_filled(num_overall) + IdxSetBuf::new_filled(num_overall) } else { - OwnIdxSet::new_empty(num_overall) + IdxSetBuf::new_empty(num_overall) }); DataflowAnalysis { diff --git a/src/librustc_borrowck/indexed_set.rs b/src/librustc_borrowck/indexed_set.rs index 2625bd4300c..3fee1dbc056 100644 --- a/src/librustc_borrowck/indexed_set.rs +++ b/src/librustc_borrowck/indexed_set.rs @@ -30,21 +30,21 @@ pub trait Idx: 'static { /// /// In other words, `T` is the type used to index into the bitvector /// this type uses to represent the set of object it holds. -pub struct OwnIdxSet<T: Idx> { +pub struct IdxSetBuf<T: Idx> { _pd: PhantomData<fn(&T)>, bits: Vec<Word>, } -impl<T: Idx> Clone for OwnIdxSet<T> { +impl<T: Idx> Clone for IdxSetBuf<T> { fn clone(&self) -> Self { - OwnIdxSet { _pd: PhantomData, bits: self.bits.clone() } + IdxSetBuf { _pd: PhantomData, bits: self.bits.clone() } } } // pnkfelix wants to have this be `IdxSet<T>([Word]) and then pass // around `&mut IdxSet<T>` or `&IdxSet<T>`. // -// WARNING: Mapping a `&OwnIdxSet<T>` to `&IdxSet<T>` (at least today) +// WARNING: Mapping a `&IdxSetBuf<T>` to `&IdxSet<T>` (at least today) // requires a transmute relying on representation guarantees that may // not hold in the future. @@ -58,7 +58,7 @@ pub struct IdxSet<T: Idx> { bits: [Word], } -impl<T: Idx> fmt::Debug for OwnIdxSet<T> { +impl<T: Idx> fmt::Debug for IdxSetBuf<T> { fn fmt(&self, w: &mut fmt::Formatter) -> fmt::Result { self.bits.fmt(w) } } @@ -66,11 +66,11 @@ impl<T: Idx> fmt::Debug for IdxSet<T> { fn fmt(&self, w: &mut fmt::Formatter) -> fmt::Result { self.bits.fmt(w) } } -impl<T: Idx> OwnIdxSet<T> { +impl<T: Idx> IdxSetBuf<T> { fn new(init: Word, universe_size: usize) -> Self { let bits_per_word = mem::size_of::<Word>() * 8; let num_words = (universe_size + (bits_per_word - 1)) / bits_per_word; - OwnIdxSet { + IdxSetBuf { _pd: Default::default(), bits: vec![init; num_words], } @@ -97,22 +97,22 @@ impl<T: Idx> IdxSet<T> { } } -impl<T: Idx> Deref for OwnIdxSet<T> { +impl<T: Idx> Deref for IdxSetBuf<T> { type Target = IdxSet<T>; fn deref(&self) -> &IdxSet<T> { unsafe { IdxSet::from_slice(&self.bits[..]) } } } -impl<T: Idx> DerefMut for OwnIdxSet<T> { +impl<T: Idx> DerefMut for IdxSetBuf<T> { fn deref_mut(&mut self) -> &mut IdxSet<T> { unsafe { IdxSet::from_slice_mut(&mut self.bits[..]) } } } impl<T: Idx> IdxSet<T> { - pub fn to_owned(&self) -> OwnIdxSet<T> { - OwnIdxSet { + pub fn to_owned(&self) -> IdxSetBuf<T> { + IdxSetBuf { _pd: Default::default(), bits: self.bits.to_owned(), } |
