diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2017-04-04 08:10:22 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2017-04-04 08:13:27 -0700 |
| commit | dedb7bbbbf272226f327b8cda8aaa12cf6325eca (patch) | |
| tree | 9c7c7b656750a53b5ca4f7646ee1dfe60829b271 /src/librustc_data_structures | |
| parent | b477682dca3343eb89a467f0d3c73986a53d49d9 (diff) | |
| parent | 5309a3e31d88def1f3ea966162ed4f81f161d500 (diff) | |
Merge branch 'master' into issue-32540
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/librustc_data_structures/accumulate_vec.rs | 8 | ||||
| -rw-r--r-- | src/librustc_data_structures/base_n.rs | 2 | ||||
| -rw-r--r-- | src/librustc_data_structures/blake2b.rs | 2 | ||||
| -rw-r--r-- | src/librustc_data_structures/indexed_set.rs | 8 | ||||
| -rw-r--r-- | src/librustc_data_structures/indexed_vec.rs | 7 | ||||
| -rw-r--r-- | src/librustc_data_structures/lib.rs | 1 |
7 files changed, 18 insertions, 12 deletions
diff --git a/src/librustc_data_structures/Cargo.toml b/src/librustc_data_structures/Cargo.toml index e2e16059d98..343b1ed68b8 100644 --- a/src/librustc_data_structures/Cargo.toml +++ b/src/librustc_data_structures/Cargo.toml @@ -9,5 +9,5 @@ path = "lib.rs" crate-type = ["dylib"] [dependencies] -log = { path = "../liblog" } +log = "0.3" serialize = { path = "../libserialize" } diff --git a/src/librustc_data_structures/accumulate_vec.rs b/src/librustc_data_structures/accumulate_vec.rs index d4bd9e707fd..c03c2890ba3 100644 --- a/src/librustc_data_structures/accumulate_vec.rs +++ b/src/librustc_data_structures/accumulate_vec.rs @@ -91,8 +91,8 @@ impl<A: Array> Deref for AccumulateVec<A> { type Target = [A::Element]; fn deref(&self) -> &Self::Target { match *self { - AccumulateVec::Array(ref v) => &v[..], - AccumulateVec::Heap(ref v) => &v[..], + AccumulateVec::Array(ref v) => v, + AccumulateVec::Heap(ref v) => v, } } } @@ -100,8 +100,8 @@ impl<A: Array> Deref for AccumulateVec<A> { impl<A: Array> DerefMut for AccumulateVec<A> { fn deref_mut(&mut self) -> &mut [A::Element] { match *self { - AccumulateVec::Array(ref mut v) => &mut v[..], - AccumulateVec::Heap(ref mut v) => &mut v[..], + AccumulateVec::Array(ref mut v) => v, + AccumulateVec::Heap(ref mut v) => v, } } } diff --git a/src/librustc_data_structures/base_n.rs b/src/librustc_data_structures/base_n.rs index 4359581a897..cf54229fa7f 100644 --- a/src/librustc_data_structures/base_n.rs +++ b/src/librustc_data_structures/base_n.rs @@ -48,7 +48,7 @@ pub fn encode(n: u64, base: u64) -> String { #[test] fn test_encode() { fn test(n: u64, base: u64) { - assert_eq!(Ok(n), u64::from_str_radix(&encode(n, base)[..], base as u32)); + assert_eq!(Ok(n), u64::from_str_radix(&encode(n, base), base as u32)); } for base in 2..37 { diff --git a/src/librustc_data_structures/blake2b.rs b/src/librustc_data_structures/blake2b.rs index 31492e26219..9d97a83f693 100644 --- a/src/librustc_data_structures/blake2b.rs +++ b/src/librustc_data_structures/blake2b.rs @@ -35,7 +35,7 @@ pub struct Blake2bCtx { impl ::std::fmt::Debug for Blake2bCtx { fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> { try!(write!(fmt, "hash: ")); - for v in &self.h[..] { + for v in &self.h { try!(write!(fmt, "{:x}", v)); } Ok(()) diff --git a/src/librustc_data_structures/indexed_set.rs b/src/librustc_data_structures/indexed_set.rs index 2e9e054e97e..572ce98d3ae 100644 --- a/src/librustc_data_structures/indexed_set.rs +++ b/src/librustc_data_structures/indexed_set.rs @@ -91,13 +91,13 @@ impl<T: Idx> IdxSet<T> { impl<T: Idx> Deref for IdxSetBuf<T> { type Target = IdxSet<T>; fn deref(&self) -> &IdxSet<T> { - unsafe { IdxSet::from_slice(&self.bits[..]) } + unsafe { IdxSet::from_slice(&self.bits) } } } impl<T: Idx> DerefMut for IdxSetBuf<T> { fn deref_mut(&mut self) -> &mut IdxSet<T> { - unsafe { IdxSet::from_slice_mut(&mut self.bits[..]) } + unsafe { IdxSet::from_slice_mut(&mut self.bits) } } } @@ -135,11 +135,11 @@ impl<T: Idx> IdxSet<T> { } pub fn words(&self) -> &[Word] { - &self.bits[..] + &self.bits } pub fn words_mut(&mut self) -> &mut [Word] { - &mut self.bits[..] + &mut self.bits } pub fn clone_from(&mut self, other: &IdxSet<T>) { diff --git a/src/librustc_data_structures/indexed_vec.rs b/src/librustc_data_structures/indexed_vec.rs index 3f478d7c165..62c430dda32 100644 --- a/src/librustc_data_structures/indexed_vec.rs +++ b/src/librustc_data_structures/indexed_vec.rs @@ -189,6 +189,13 @@ impl<I: Idx, T> IndexVec<I, T> { } } +impl<I: Idx, T: Clone> IndexVec<I, T> { + #[inline] + pub fn resize(&mut self, new_len: usize, value: T) { + self.raw.resize(new_len, value) + } +} + impl<I: Idx, T> Index<I> for IndexVec<I, T> { type Output = T; diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs index 8ecfd75dc95..9ccd95dd8d8 100644 --- a/src/librustc_data_structures/lib.rs +++ b/src/librustc_data_structures/lib.rs @@ -27,7 +27,6 @@ #![feature(shared)] #![feature(collections_range)] -#![cfg_attr(stage0,feature(field_init_shorthand))] #![feature(nonzero)] #![feature(rustc_private)] #![feature(staged_api)] |
