Skip to content

Commit 0854a25

Browse files
committed
---
yaml --- r: 105067 b: refs/heads/snap-stage3 c: ae42905 h: refs/heads/master i: 105065: 64e9e00 105063: 2369194 v: v3
1 parent eb011dd commit 0854a25

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+406
-534
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 62f1d68439dcfd509eaca29887afa97f22938373
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 2ddb60565423bdc225ccc8dd4ebfb653c5650ba2
4+
refs/heads/snap-stage3: ae429056ffa166a9d3a15c8641a838a7a2f5f86e
55
refs/heads/try: db814977d07bd798feb24f6b74c00800ef458a13
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
452452
let options_to_remove = [~"-O", ~"-g", ~"--debuginfo"];
453453
let new_options = split_maybe_args(options).move_iter()
454454
.filter(|x| !options_to_remove.contains(x))
455-
.to_owned_vec()
455+
.collect::<~[~str]>()
456456
.connect(" ");
457457
Some(new_options)
458458
}

branches/snap-stage3/src/doc/guide-tasks.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -493,14 +493,14 @@ Here is the function that implements the child task:
493493
~~~
494494
extern crate sync;
495495
# fn main() {
496-
fn stringifier(channel: &sync::DuplexStream<~str, uint>) {
497-
let mut value: uint;
498-
loop {
499-
value = channel.recv();
500-
channel.send(value.to_str());
501-
if value == 0 { break; }
496+
fn stringifier(channel: &sync::DuplexStream<~str, uint>) {
497+
let mut value: uint;
498+
loop {
499+
value = channel.recv();
500+
channel.send(value.to_str());
501+
if value == 0 { break; }
502+
}
502503
}
503-
}
504504
# }
505505
~~~~
506506

branches/snap-stage3/src/libcollections/enum_set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
1616
use std::num::Bitwise;
1717

18-
#[deriving(Clone, Eq, TotalEq, Hash, Show)]
18+
#[deriving(Clone, Eq, Hash, Show)]
1919
/// A specialized Set implementation to use enum types.
2020
pub struct EnumSet<E> {
2121
// We must maintain the invariant that no bits are set

branches/snap-stage3/src/libcollections/hashmap.rs

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1313
use std::container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
1414
use std::clone::Clone;
15-
use std::cmp::{Eq, TotalEq, Equiv, max};
15+
use std::cmp::{Eq, Equiv, max};
1616
use std::default::Default;
1717
use std::fmt;
1818
use std::fmt::Show;
@@ -140,7 +140,6 @@ mod table {
140140
}
141141

142142
/// A hash that is not zero, since we use that to represent empty buckets.
143-
#[deriving(Eq)]
144143
pub struct SafeHash {
145144
priv hash: u64,
146145
}
@@ -150,6 +149,10 @@ mod table {
150149
pub fn inspect(&self) -> u64 { self.hash }
151150
}
152151

152+
impl Eq for SafeHash {
153+
fn eq(&self, other: &SafeHash) -> bool { self.hash == other.hash }
154+
}
155+
153156
/// We need to remove hashes of 0. That's reserved for empty buckets.
154157
/// This function wraps up `hash_keyed` to be the only way outside this
155158
/// module to generate a SafeHash.
@@ -695,7 +698,7 @@ fn grow_at(capacity: uint, load_factor: Fraction) -> uint {
695698
fraction_mul(capacity, load_factor)
696699
}
697700

698-
impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
701+
impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
699702
/// Get the number of elements which will force the capacity to shrink.
700703
/// When size == self.shrink_at(), we halve the capacity.
701704
fn shrink_at(&self) -> uint {
@@ -796,12 +799,12 @@ impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
796799
}
797800
}
798801

799-
impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> Container for HashMap<K, V, H> {
802+
impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> Container for HashMap<K, V, H> {
800803
/// Return the number of elements in the map
801804
fn len(&self) -> uint { self.table.size() }
802805
}
803806

804-
impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> Mutable for HashMap<K, V, H> {
807+
impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> Mutable for HashMap<K, V, H> {
805808
/// Clear the map, removing all key-value pairs.
806809
fn clear(&mut self) {
807810
self.minimum_capacity = self.table.size();
@@ -816,7 +819,7 @@ impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> Mutable for HashMap<K, V, H> {
816819
}
817820

818821

819-
impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> Map<K, V> for HashMap<K, V, H> {
822+
impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> Map<K, V> for HashMap<K, V, H> {
820823
fn find<'a>(&'a self, k: &K) -> Option<&'a V> {
821824
self.search(k).map(|idx| {
822825
let (_, v) = self.table.read(&idx);
@@ -829,7 +832,7 @@ impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> Map<K, V> for HashMap<K, V, H> {
829832
}
830833
}
831834

832-
impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> MutableMap<K, V> for HashMap<K, V, H> {
835+
impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> MutableMap<K, V> for HashMap<K, V, H> {
833836
fn find_mut<'a>(&'a mut self, k: &K) -> Option<&'a mut V> {
834837
match self.search(k) {
835838
None => None,
@@ -966,7 +969,7 @@ impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> MutableMap<K, V> for HashMap<K, V
966969
}
967970
}
968971

969-
impl<K: Hash + TotalEq, V> HashMap<K, V, sip::SipHasher> {
972+
impl<K: Hash + Eq, V> HashMap<K, V, sip::SipHasher> {
970973
/// Create an empty HashMap.
971974
pub fn new() -> HashMap<K, V, sip::SipHasher> {
972975
HashMap::with_capacity(INITIAL_CAPACITY)
@@ -981,7 +984,7 @@ impl<K: Hash + TotalEq, V> HashMap<K, V, sip::SipHasher> {
981984
}
982985
}
983986

984-
impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
987+
impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
985988
pub fn with_hasher(hasher: H) -> HashMap<K, V, H> {
986989
HashMap::with_capacity_and_hasher(INITIAL_CAPACITY, hasher)
987990
}
@@ -1293,7 +1296,7 @@ impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
12931296
}
12941297
}
12951298

1296-
impl<K: TotalEq + Hash<S>, V: Clone, S, H: Hasher<S>> HashMap<K, V, H> {
1299+
impl<K: Eq + Hash<S>, V: Clone, S, H: Hasher<S>> HashMap<K, V, H> {
12971300
/// Like `find`, but returns a copy of the value.
12981301
pub fn find_copy(&self, k: &K) -> Option<V> {
12991302
self.find(k).map(|v| (*v).clone())
@@ -1305,7 +1308,7 @@ impl<K: TotalEq + Hash<S>, V: Clone, S, H: Hasher<S>> HashMap<K, V, H> {
13051308
}
13061309
}
13071310

1308-
impl<K: TotalEq + Hash<S>, V: Eq, S, H: Hasher<S>> Eq for HashMap<K, V, H> {
1311+
impl<K: Eq + Hash<S>, V: Eq, S, H: Hasher<S>> Eq for HashMap<K, V, H> {
13091312
fn eq(&self, other: &HashMap<K, V, H>) -> bool {
13101313
if self.len() != other.len() { return false; }
13111314

@@ -1318,7 +1321,7 @@ impl<K: TotalEq + Hash<S>, V: Eq, S, H: Hasher<S>> Eq for HashMap<K, V, H> {
13181321
}
13191322
}
13201323

1321-
impl<K: TotalEq + Hash<S> + Show, V: Show, S, H: Hasher<S>> Show for HashMap<K, V, H> {
1324+
impl<K: Eq + Hash<S> + Show, V: Show, S, H: Hasher<S>> Show for HashMap<K, V, H> {
13221325
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
13231326
try!(write!(f.buf, r"\{"));
13241327

@@ -1331,7 +1334,7 @@ impl<K: TotalEq + Hash<S> + Show, V: Show, S, H: Hasher<S>> Show for HashMap<K,
13311334
}
13321335
}
13331336

1334-
impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S> + Default> Default for HashMap<K, V, H> {
1337+
impl<K: Eq + Hash<S>, V, S, H: Hasher<S> + Default> Default for HashMap<K, V, H> {
13351338
fn default() -> HashMap<K, V, H> {
13361339
HashMap::with_capacity_and_hasher(INITIAL_CAPACITY, Default::default())
13371340
}
@@ -1355,7 +1358,7 @@ pub type Keys<'a, K, V> =
13551358
pub type Values<'a, K, V> =
13561359
iter::Map<'static, (&'a K, &'a V), &'a V, Entries<'a, K, V>>;
13571360

1358-
impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S> + Default> FromIterator<(K, V)> for HashMap<K, V, H> {
1361+
impl<K: Eq + Hash<S>, V, S, H: Hasher<S> + Default> FromIterator<(K, V)> for HashMap<K, V, H> {
13591362
fn from_iterator<T: Iterator<(K, V)>>(iter: &mut T) -> HashMap<K, V, H> {
13601363
let (lower, _) = iter.size_hint();
13611364
let mut map = HashMap::with_capacity_and_hasher(lower, Default::default());
@@ -1364,7 +1367,7 @@ impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S> + Default> FromIterator<(K, V)> fo
13641367
}
13651368
}
13661369

1367-
impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S> + Default> Extendable<(K, V)> for HashMap<K, V, H> {
1370+
impl<K: Eq + Hash<S>, V, S, H: Hasher<S> + Default> Extendable<(K, V)> for HashMap<K, V, H> {
13681371
fn extend<T: Iterator<(K, V)>>(&mut self, iter: &mut T) {
13691372
for (k, v) in *iter {
13701373
self.insert(k, v);
@@ -1388,7 +1391,7 @@ pub struct HashSet<T, H = sip::SipHasher> {
13881391
priv map: HashMap<T, (), H>
13891392
}
13901393

1391-
impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> Eq for HashSet<T, H> {
1394+
impl<T: Eq + Hash<S>, S, H: Hasher<S>> Eq for HashSet<T, H> {
13921395
// FIXME #11998: Since the value is a (), and `find` returns a Some(&()),
13931396
// we trigger #11998 when matching on it. I've fallen back to manual
13941397
// iteration until this is fixed.
@@ -1399,17 +1402,17 @@ impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> Eq for HashSet<T, H> {
13991402
}
14001403
}
14011404

1402-
impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> Container for HashSet<T, H> {
1405+
impl<T: Eq + Hash<S>, S, H: Hasher<S>> Container for HashSet<T, H> {
14031406
/// Return the number of elements in the set
14041407
fn len(&self) -> uint { self.map.len() }
14051408
}
14061409

1407-
impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> Mutable for HashSet<T, H> {
1410+
impl<T: Eq + Hash<S>, S, H: Hasher<S>> Mutable for HashSet<T, H> {
14081411
/// Clear the set, removing all values.
14091412
fn clear(&mut self) { self.map.clear() }
14101413
}
14111414

1412-
impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> Set<T> for HashSet<T, H> {
1415+
impl<T: Eq + Hash<S>, S, H: Hasher<S>> Set<T> for HashSet<T, H> {
14131416
/// Return true if the set contains a value
14141417
fn contains(&self, value: &T) -> bool { self.map.search(value).is_some() }
14151418

@@ -1430,7 +1433,7 @@ impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> Set<T> for HashSet<T, H> {
14301433
}
14311434
}
14321435

1433-
impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> MutableSet<T> for HashSet<T, H> {
1436+
impl<T: Eq + Hash<S>, S, H: Hasher<S>> MutableSet<T> for HashSet<T, H> {
14341437
/// Add a value to the set. Return true if the value was not already
14351438
/// present in the set.
14361439
fn insert(&mut self, value: T) -> bool { self.map.insert(value, ()) }
@@ -1440,7 +1443,7 @@ impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> MutableSet<T> for HashSet<T, H> {
14401443
fn remove(&mut self, value: &T) -> bool { self.map.remove(value) }
14411444
}
14421445

1443-
impl<T: Hash + TotalEq> HashSet<T, sip::SipHasher> {
1446+
impl<T: Hash + Eq> HashSet<T, sip::SipHasher> {
14441447
/// Create an empty HashSet
14451448
pub fn new() -> HashSet<T, sip::SipHasher> {
14461449
HashSet::with_capacity(INITIAL_CAPACITY)
@@ -1453,7 +1456,7 @@ impl<T: Hash + TotalEq> HashSet<T, sip::SipHasher> {
14531456
}
14541457
}
14551458

1456-
impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
1459+
impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
14571460
pub fn with_hasher(hasher: H) -> HashSet<T, H> {
14581461
HashSet::with_capacity_and_hasher(INITIAL_CAPACITY, hasher)
14591462
}
@@ -1526,7 +1529,7 @@ impl<T: TotalEq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
15261529

15271530
}
15281531

1529-
impl<T: TotalEq + Hash<S> + fmt::Show, S, H: Hasher<S>> fmt::Show for HashSet<T, H> {
1532+
impl<T: Eq + Hash<S> + fmt::Show, S, H: Hasher<S>> fmt::Show for HashSet<T, H> {
15301533
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
15311534
try!(write!(f.buf, r"\{"));
15321535

@@ -1539,7 +1542,7 @@ impl<T: TotalEq + Hash<S> + fmt::Show, S, H: Hasher<S>> fmt::Show for HashSet<T,
15391542
}
15401543
}
15411544

1542-
impl<T: TotalEq + Hash<S>, S, H: Hasher<S> + Default> FromIterator<T> for HashSet<T, H> {
1545+
impl<T: Eq + Hash<S>, S, H: Hasher<S> + Default> FromIterator<T> for HashSet<T, H> {
15431546
fn from_iterator<I: Iterator<T>>(iter: &mut I) -> HashSet<T, H> {
15441547
let (lower, _) = iter.size_hint();
15451548
let mut set = HashSet::with_capacity_and_hasher(lower, Default::default());
@@ -1548,15 +1551,15 @@ impl<T: TotalEq + Hash<S>, S, H: Hasher<S> + Default> FromIterator<T> for HashSe
15481551
}
15491552
}
15501553

1551-
impl<T: TotalEq + Hash<S>, S, H: Hasher<S> + Default> Extendable<T> for HashSet<T, H> {
1554+
impl<T: Eq + Hash<S>, S, H: Hasher<S> + Default> Extendable<T> for HashSet<T, H> {
15521555
fn extend<I: Iterator<T>>(&mut self, iter: &mut I) {
15531556
for k in *iter {
15541557
self.insert(k);
15551558
}
15561559
}
15571560
}
15581561

1559-
impl<T: TotalEq + Hash> Default for HashSet<T, sip::SipHasher> {
1562+
impl<T: Eq + Hash> Default for HashSet<T, sip::SipHasher> {
15601563
fn default() -> HashSet<T> { HashSet::new() }
15611564
}
15621565

@@ -1598,7 +1601,7 @@ mod test_map {
15981601

15991602
local_data_key!(drop_vector: vec::Vec<int>)
16001603

1601-
#[deriving(Hash, Eq, TotalEq)]
1604+
#[deriving(Hash, Eq)]
16021605
struct Dropable {
16031606
k: int
16041607
}

branches/snap-stage3/src/libcollections/lru_cache.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ impl<K: Eq> Eq for KeyRef<K> {
7474
}
7575
}
7676

77-
impl<K: TotalEq> TotalEq for KeyRef<K> {}
78-
7977
impl<K, V> LruEntry<K, V> {
8078
fn new() -> LruEntry<K, V> {
8179
LruEntry {
@@ -96,7 +94,7 @@ impl<K, V> LruEntry<K, V> {
9694
}
9795
}
9896

99-
impl<K: Hash + TotalEq, V> LruCache<K, V> {
97+
impl<K: Hash + Eq, V> LruCache<K, V> {
10098
/// Create an LRU Cache that holds at most `capacity` items.
10199
pub fn new(capacity: uint) -> LruCache<K, V> {
102100
let cache = LruCache {
@@ -220,7 +218,7 @@ impl<K: Hash + TotalEq, V> LruCache<K, V> {
220218
}
221219
}
222220

223-
impl<A: fmt::Show + Hash + TotalEq, B: fmt::Show> fmt::Show for LruCache<A, B> {
221+
impl<A: fmt::Show + Hash + Eq, B: fmt::Show> fmt::Show for LruCache<A, B> {
224222
/// Return a string that lists the key-value pairs from most-recently
225223
/// used to least-recently used.
226224
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -249,14 +247,14 @@ impl<A: fmt::Show + Hash + TotalEq, B: fmt::Show> fmt::Show for LruCache<A, B> {
249247
}
250248
}
251249

252-
impl<K: Hash + TotalEq, V> Container for LruCache<K, V> {
250+
impl<K: Hash + Eq, V> Container for LruCache<K, V> {
253251
/// Return the number of key-value pairs in the cache.
254252
fn len(&self) -> uint {
255253
self.map.len()
256254
}
257255
}
258256

259-
impl<K: Hash + TotalEq, V> Mutable for LruCache<K, V> {
257+
impl<K: Hash + Eq, V> Mutable for LruCache<K, V> {
260258
/// Clear the cache of all key-value pairs.
261259
fn clear(&mut self) {
262260
self.map.clear();

branches/snap-stage3/src/libglob/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ impl Pattern {
223223
*/
224224
pub fn new(pattern: &str) -> Pattern {
225225

226-
let chars = pattern.chars().to_owned_vec();
226+
let chars = pattern.chars().collect::<~[_]>();
227227
let mut tokens = Vec::new();
228228
let mut i = 0;
229229

branches/snap-stage3/src/librand/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ mod test {
826826
let max_val = 100;
827827

828828
let mut r = task_rng();
829-
let vals = range(min_val, max_val).to_owned_vec();
829+
let vals = range(min_val, max_val).collect::<~[int]>();
830830
let small_sample = r.sample(vals.iter(), 5);
831831
let large_sample = r.sample(vals.iter(), vals.len() + 5);
832832

branches/snap-stage3/src/librustc/metadata/creader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ fn visit_item(e: &Env, i: &ast::Item) {
197197
} else {
198198
None
199199
})
200-
.to_owned_vec();
200+
.collect::<~[&ast::Attribute]>();
201201
for m in link_args.iter() {
202202
match m.value_str() {
203203
Some(linkarg) => e.sess.cstore.add_used_link_args(linkarg.get()),
@@ -212,7 +212,7 @@ fn visit_item(e: &Env, i: &ast::Item) {
212212
} else {
213213
None
214214
})
215-
.to_owned_vec();
215+
.collect::<~[&ast::Attribute]>();
216216
for m in link_args.iter() {
217217
match m.meta_item_list() {
218218
Some(items) => {

0 commit comments

Comments
 (0)