Skip to content

Commit 3ccab04

Browse files
committed
---
yaml --- r: 41831 b: refs/heads/master c: a438bdc h: refs/heads/master i: 41829: 38ff5ef 41827: f974c00 41823: 4c4908b v: v3
1 parent 071f046 commit 3ccab04

File tree

6 files changed

+23
-88
lines changed

6 files changed

+23
-88
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5320e132d1f60a7787f8290b7d8c7e16fcf9ccae
2+
refs/heads/master: a438bdc8a6b2be0dc3583f42d00b7800038fd64a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650

trunk/src/libcore/container.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.

trunk/src/libcore/core.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ pub mod to_bytes;
122122
pub mod clone;
123123
pub mod io;
124124
pub mod hash;
125-
pub mod container;
126125

127126

128127
/* Common data structures */

trunk/src/libcore/repr.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,13 @@ impl ReprVisitor : TyVisitor {
286286
fn visit_f32() -> bool { self.write::<f32>() }
287287
fn visit_f64() -> bool { self.write::<f64>() }
288288

289-
fn visit_char() -> bool { self.write::<u32>() }
289+
fn visit_char() -> bool {
290+
do self.get::<char> |&ch| {
291+
self.writer.write_char('\'');
292+
self.writer.write_escaped_char(ch);
293+
self.writer.write_char('\'');
294+
}
295+
}
290296

291297
// Type no longer exists, vestigial function.
292298
fn visit_str() -> bool { fail; }

trunk/src/libcore/send_map.rs

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -46,8 +46,6 @@ pub trait SendMap<K:Eq Hash, V: Copy> {
4646

4747
/// Open addressing with linear probing.
4848
pub mod linear {
49-
use iter::BaseIter;
50-
use container::Set;
5149
use cmp::Eq;
5250
use cmp;
5351
use hash::Hash;
@@ -444,7 +442,7 @@ pub mod linear {
444442
}
445443
}
446444

447-
impl<K:Hash IterBytes Eq, V: Eq> LinearMap<K, V>: Eq {
445+
impl<K:Hash IterBytes Eq, V: Eq> LinearMap<K, V>: cmp::Eq {
448446
pure fn eq(&self, other: &LinearMap<K, V>) -> bool {
449447
if self.len() != other.len() { return false; }
450448

@@ -462,47 +460,6 @@ pub mod linear {
462460
!self.eq(other)
463461
}
464462
}
465-
466-
pub struct LinearSet<T: Hash IterBytes Eq> {
467-
priv map: LinearMap<T, ()>
468-
}
469-
470-
impl <T: Hash IterBytes Eq> LinearSet<T>: BaseIter<T> {
471-
/// Visit all values in order
472-
pure fn each(&self, f: fn(&T) -> bool) { self.map.each_key(f) }
473-
pure fn size_hint(&self) -> Option<uint> { Some(self.len()) }
474-
}
475-
476-
impl <T: Hash IterBytes Eq> LinearSet<T>: Eq {
477-
pure fn eq(&self, other: &LinearSet<T>) -> bool { self.map == other.map }
478-
pure fn ne(&self, other: &LinearSet<T>) -> bool { self.map != other.map }
479-
}
480-
481-
impl <T: Hash IterBytes Eq> LinearSet<T>: Set<T> {
482-
/// Return true if the set contains a value
483-
pure fn contains(&self, value: &T) -> bool {
484-
self.map.contains_key(value)
485-
}
486-
487-
/// Add a value to the set. Return true if the value was not already
488-
/// present in the set.
489-
fn insert(&mut self, value: T) -> bool { self.map.insert(value, ()) }
490-
491-
/// Remove a value from the set. Return true if the value was
492-
/// present in the set.
493-
fn remove(&mut self, value: &T) -> bool { self.map.remove(value) }
494-
}
495-
496-
impl <T: Hash IterBytes Eq> LinearSet<T> {
497-
/// Create an empty LinearSet
498-
static fn new() -> LinearSet<T> { LinearSet{map: LinearMap()} }
499-
500-
/// Return the number of elements in the set
501-
pure fn len(&self) -> uint { self.map.len() }
502-
503-
/// Return true if the set contains no elements
504-
pure fn is_empty(&self) -> bool { self.map.is_empty() }
505-
}
506463
}
507464

508465
#[test]

trunk/src/libstd/treemap.rs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
1515
#[forbid(deprecated_mode)];
1616

17-
use core::container::Set;
1817
use core::cmp::{Eq, Ord};
1918
use core::option::{Option, Some, None};
2019
use core::prelude::*;
@@ -198,21 +197,6 @@ impl <T: Eq Ord> TreeSet<T>: Eq {
198197
pure fn ne(&self, other: &TreeSet<T>) -> bool { self.map != other.map }
199198
}
200199

201-
impl <T: Ord> TreeSet<T>: Set<T> {
202-
/// Return true if the set contains a value
203-
pure fn contains(&self, value: &T) -> bool {
204-
self.map.contains_key(value)
205-
}
206-
207-
/// Add a value to the set. Return true if the value was not already
208-
/// present in the set.
209-
fn insert(&mut self, value: T) -> bool { self.map.insert(value, ()) }
210-
211-
/// Remove a value from the set. Return true if the value was
212-
/// present in the set.
213-
fn remove(&mut self, value: &T) -> bool { self.map.remove(value) }
214-
}
215-
216200
impl <T: Ord> TreeSet<T> {
217201
/// Create an empty TreeSet
218202
static pure fn new() -> TreeSet<T> { TreeSet{map: TreeMap::new()} }
@@ -231,6 +215,19 @@ impl <T: Ord> TreeSet<T> {
231215
self.map.each_key_reverse(f)
232216
}
233217

218+
/// Return true if the set contains a value
219+
pure fn contains(&self, value: &T) -> bool {
220+
self.map.contains_key(value)
221+
}
222+
223+
/// Add a value to the set. Return true if the value was not
224+
/// already present in the set.
225+
fn insert(&mut self, value: T) -> bool { self.map.insert(value, ()) }
226+
227+
/// Remove a value from the set. Return true if the value was
228+
/// present in the set.
229+
fn remove(&mut self, value: &T) -> bool { self.map.remove(value) }
230+
234231
/// Get a lazy iterator over the values in the set.
235232
/// Requires that it be frozen (immutable).
236233
pure fn iter(&self) -> TreeSetIterator/&self<T> {

0 commit comments

Comments
 (0)