Skip to content

Commit 2b0f13f

Browse files
committed
Address nits
1 parent 4ca2f7a commit 2b0f13f

File tree

6 files changed

+3
-338
lines changed

6 files changed

+3
-338
lines changed

src/libcollections/enum_set.rs

-283
This file was deleted.

src/libcollections/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ pub use bit_set::BitSet;
8282
pub use btree_map::BTreeMap;
8383
pub use btree_set::BTreeSet;
8484
pub use linked_list::LinkedList;
85-
#[allow(deprecated)]
86-
pub use enum_set::EnumSet;
8785
pub use vec_deque::VecDeque;
8886
pub use string::String;
8987
pub use vec::Vec;
@@ -99,7 +97,6 @@ pub mod binary_heap;
9997
mod bit;
10098
mod btree;
10199
pub mod borrow;
102-
pub mod enum_set;
103100
pub mod fmt;
104101
pub mod linked_list;
105102
pub mod range;

src/librustc/middle/ty.rs

+2-14
Original file line numberDiff line numberDiff line change
@@ -2068,23 +2068,11 @@ impl BuiltinBounds {
20682068
}
20692069

20702070
pub fn insert(&mut self, bound: BuiltinBound) {
2071-
self.bits = match bound {
2072-
BuiltinBound::Send => self.bits | 0b0000_0001,
2073-
BuiltinBound::Sized => self.bits | 0b0000_0010,
2074-
BuiltinBound::Copy => self.bits | 0b0000_0100,
2075-
BuiltinBound::Sync => self.bits | 0b0000_1000,
2076-
}
2071+
self.bits |= 1 << (bound as u8);
20772072
}
20782073

20792074
pub fn contains(&self, bound: BuiltinBound) -> bool {
2080-
let bit = match bound {
2081-
BuiltinBound::Send => self.bits,
2082-
BuiltinBound::Sized => self.bits >> 1,
2083-
BuiltinBound::Copy => self.bits >> 2,
2084-
BuiltinBound::Sync => self.bits >> 3
2085-
};
2086-
2087-
(bit & 0b0000_0001) == 1
2075+
((self.bits >> (bound as u8)) & 1) == 1
20882076
}
20892077

20902078
pub fn iter(&self) -> BuiltinBoundsIter {

src/libserialize/collection_impls.rs

-32
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@
1010

1111
//! Implementations of serialization for structures found in libcollections
1212
13-
use std::usize;
1413
use std::default::Default;
1514
use std::hash::Hash;
1615
use std::collections::hash_state::HashState;
1716

1817
use {Decodable, Encodable, Decoder, Encoder};
1918
use std::collections::{LinkedList, VecDeque, BTreeMap, BTreeSet, HashMap, HashSet, VecMap};
20-
#[allow(deprecated)]
21-
use collections::enum_set::{EnumSet, CLike};
2219

2320
impl<
2421
T: Encodable
@@ -131,35 +128,6 @@ impl<
131128
}
132129
}
133130

134-
#[allow(deprecated)]
135-
impl<
136-
T: Encodable + CLike
137-
> Encodable for EnumSet<T> {
138-
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
139-
let mut bits = 0;
140-
for item in self {
141-
bits |= item.to_usize();
142-
}
143-
s.emit_uint(bits)
144-
}
145-
}
146-
147-
#[allow(deprecated)]
148-
impl<
149-
T: Decodable + CLike
150-
> Decodable for EnumSet<T> {
151-
fn decode<D: Decoder>(d: &mut D) -> Result<EnumSet<T>, D::Error> {
152-
let bits = try!(d.read_uint());
153-
let mut set = EnumSet::new();
154-
for bit in 0..usize::BITS {
155-
if bits & (1 << bit) != 0 {
156-
set.insert(CLike::from_usize(1 << bit));
157-
}
158-
}
159-
Ok(set)
160-
}
161-
}
162-
163131
impl<K, V, S> Encodable for HashMap<K, V, S>
164132
where K: Encodable + Hash + Eq,
165133
V: Encodable,

src/libserialize/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ Core encoding and decoding interfaces.
2929

3030
#![feature(box_syntax)]
3131
#![feature(collections)]
32-
#![feature(enumset)]
3332
#![feature(hashmap_hasher)]
34-
#![feature(num_bits_bytes)]
3533
#![feature(rustc_private)]
3634
#![feature(staged_api)]
3735
#![feature(str_char)]

0 commit comments

Comments
 (0)