Skip to content

Commit df5c116

Browse files
committed
Alpha rename OwnIdxSet to IdxSetBuf.
1 parent ad0e6ad commit df5c116

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/librustc_borrowck/borrowck/mir/dataflow/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use super::MirBorrowckCtxtPreDataflow;
2121
use super::MoveDataParamEnv;
2222

2323
use bitslice::{bitwise, BitwiseOperator};
24-
use indexed_set::{Idx, IdxSet, OwnIdxSet};
24+
use indexed_set::{Idx, IdxSet, IdxSetBuf};
2525

2626
pub use self::sanity_check::sanity_check_via_rustc_peek;
2727
pub use self::impls::{MaybeInitializedLvals, MaybeUninitializedLvals};
@@ -57,7 +57,7 @@ impl<'a, 'tcx: 'a, BD> DataflowAnalysis<'a, 'tcx, BD>
5757
where BD: BitDenotation + DataflowOperator
5858
{
5959
fn propagate(&mut self) {
60-
let mut temp = OwnIdxSet::new_empty(self.flow_state.sets.bits_per_block);
60+
let mut temp = IdxSetBuf::new_empty(self.flow_state.sets.bits_per_block);
6161
let mut propcx = PropagationContext {
6262
builder: self,
6363
changed: true,
@@ -167,15 +167,15 @@ impl<'a, 'tcx: 'a, BD> MirBorrowckCtxtPreDataflow<'a, 'tcx, BD>
167167
/// Maps each block to a set of bits
168168
#[derive(Debug)]
169169
struct Bits<E:Idx> {
170-
bits: OwnIdxSet<E>,
170+
bits: IdxSetBuf<E>,
171171
}
172172

173173
impl<E:Idx> Clone for Bits<E> {
174174
fn clone(&self) -> Self { Bits { bits: self.bits.clone() } }
175175
}
176176

177177
impl<E:Idx> Bits<E> {
178-
fn new(bits: OwnIdxSet<E>) -> Self {
178+
fn new(bits: IdxSetBuf<E>) -> Self {
179179
Bits { bits: bits }
180180
}
181181
}
@@ -393,11 +393,11 @@ impl<'a, 'tcx: 'a, D> DataflowAnalysis<'a, 'tcx, D>
393393
let num_blocks = mir.basic_blocks.len();
394394
let num_overall = num_blocks * bits_per_block;
395395

396-
let zeroes = Bits::new(OwnIdxSet::new_empty(num_overall));
396+
let zeroes = Bits::new(IdxSetBuf::new_empty(num_overall));
397397
let on_entry = Bits::new(if D::bottom_value() {
398-
OwnIdxSet::new_filled(num_overall)
398+
IdxSetBuf::new_filled(num_overall)
399399
} else {
400-
OwnIdxSet::new_empty(num_overall)
400+
IdxSetBuf::new_empty(num_overall)
401401
});
402402

403403
DataflowAnalysis {

src/librustc_borrowck/indexed_set.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ pub trait Idx: 'static {
3030
///
3131
/// In other words, `T` is the type used to index into the bitvector
3232
/// this type uses to represent the set of object it holds.
33-
pub struct OwnIdxSet<T: Idx> {
33+
pub struct IdxSetBuf<T: Idx> {
3434
_pd: PhantomData<fn(&T)>,
3535
bits: Vec<Word>,
3636
}
3737

38-
impl<T: Idx> Clone for OwnIdxSet<T> {
38+
impl<T: Idx> Clone for IdxSetBuf<T> {
3939
fn clone(&self) -> Self {
40-
OwnIdxSet { _pd: PhantomData, bits: self.bits.clone() }
40+
IdxSetBuf { _pd: PhantomData, bits: self.bits.clone() }
4141
}
4242
}
4343

4444
// pnkfelix wants to have this be `IdxSet<T>([Word]) and then pass
4545
// around `&mut IdxSet<T>` or `&IdxSet<T>`.
4646
//
47-
// WARNING: Mapping a `&OwnIdxSet<T>` to `&IdxSet<T>` (at least today)
47+
// WARNING: Mapping a `&IdxSetBuf<T>` to `&IdxSet<T>` (at least today)
4848
// requires a transmute relying on representation guarantees that may
4949
// not hold in the future.
5050

@@ -58,19 +58,19 @@ pub struct IdxSet<T: Idx> {
5858
bits: [Word],
5959
}
6060

61-
impl<T: Idx> fmt::Debug for OwnIdxSet<T> {
61+
impl<T: Idx> fmt::Debug for IdxSetBuf<T> {
6262
fn fmt(&self, w: &mut fmt::Formatter) -> fmt::Result { self.bits.fmt(w) }
6363
}
6464

6565
impl<T: Idx> fmt::Debug for IdxSet<T> {
6666
fn fmt(&self, w: &mut fmt::Formatter) -> fmt::Result { self.bits.fmt(w) }
6767
}
6868

69-
impl<T: Idx> OwnIdxSet<T> {
69+
impl<T: Idx> IdxSetBuf<T> {
7070
fn new(init: Word, universe_size: usize) -> Self {
7171
let bits_per_word = mem::size_of::<Word>() * 8;
7272
let num_words = (universe_size + (bits_per_word - 1)) / bits_per_word;
73-
OwnIdxSet {
73+
IdxSetBuf {
7474
_pd: Default::default(),
7575
bits: vec![init; num_words],
7676
}
@@ -97,22 +97,22 @@ impl<T: Idx> IdxSet<T> {
9797
}
9898
}
9999

100-
impl<T: Idx> Deref for OwnIdxSet<T> {
100+
impl<T: Idx> Deref for IdxSetBuf<T> {
101101
type Target = IdxSet<T>;
102102
fn deref(&self) -> &IdxSet<T> {
103103
unsafe { IdxSet::from_slice(&self.bits[..]) }
104104
}
105105
}
106106

107-
impl<T: Idx> DerefMut for OwnIdxSet<T> {
107+
impl<T: Idx> DerefMut for IdxSetBuf<T> {
108108
fn deref_mut(&mut self) -> &mut IdxSet<T> {
109109
unsafe { IdxSet::from_slice_mut(&mut self.bits[..]) }
110110
}
111111
}
112112

113113
impl<T: Idx> IdxSet<T> {
114-
pub fn to_owned(&self) -> OwnIdxSet<T> {
115-
OwnIdxSet {
114+
pub fn to_owned(&self) -> IdxSetBuf<T> {
115+
IdxSetBuf {
116116
_pd: Default::default(),
117117
bits: self.bits.to_owned(),
118118
}

0 commit comments

Comments
 (0)