Skip to content

Commit 8894b9e

Browse files
committed
---
yaml --- r: 125183 b: refs/heads/auto c: c770007 h: refs/heads/master i: 125181: 7cd25cb 125179: d3f134e 125175: 758871a 125167: 04f88ec 125151: 6f8acf8 125119: a2d2efc 125055: 5c7a026 124927: f1baf7a v: v3
1 parent 0ecf915 commit 8894b9e

File tree

7 files changed

+7
-141
lines changed

7 files changed

+7
-141
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 74db69995a87424098ec78aeae0964b615ba43e6
16+
refs/heads/auto: c7700077a103303a7134dcbbac574ba9ac6b6038
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libcollections/smallintmap.rs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use core::prelude::*;
1717

1818
use core::default::Default;
1919
use core::fmt;
20-
use core::iter;
2120
use core::iter::{Enumerate, FilterMap};
2221
use core::mem::replace;
2322

@@ -195,18 +194,6 @@ impl<V> SmallIntMap<V> {
195194
self.find(key).expect("key not present")
196195
}
197196

198-
/// An iterator visiting all keys in ascending order by the keys.
199-
/// Iterator element type is `uint`.
200-
pub fn keys<'r>(&'r self) -> Keys<'r, V> {
201-
self.iter().map(|(k, _v)| k)
202-
}
203-
204-
/// An iterator visiting all values in ascending order by the keys.
205-
/// Iterator element type is `&'r V`.
206-
pub fn values<'r>(&'r self) -> Values<'r, V> {
207-
self.iter().map(|(_k, v)| v)
208-
}
209-
210197
/// An iterator visiting all key-value pairs in ascending order by the keys.
211198
/// Iterator element type is `(uint, &'r V)`.
212199
///
@@ -435,14 +422,6 @@ pub struct MutEntries<'a, T> {
435422
iterator!(impl MutEntries -> (uint, &'a mut T), get_mut_ref)
436423
double_ended_iterator!(impl MutEntries -> (uint, &'a mut T), get_mut_ref)
437424

438-
/// Forward iterator over the keys of a map
439-
pub type Keys<'a, T> =
440-
iter::Map<'static, (uint, &'a T), uint, Entries<'a, T>>;
441-
442-
/// Forward iterator over the values of a map
443-
pub type Values<'a, T> =
444-
iter::Map<'static, (uint, &'a T), &'a T, Entries<'a, T>>;
445-
446425
#[cfg(test)]
447426
mod test_map {
448427
use std::prelude::*;
@@ -538,32 +517,6 @@ mod test_map {
538517
assert_eq!(m.pop(&1), None);
539518
}
540519

541-
#[test]
542-
fn test_keys() {
543-
let mut map = SmallIntMap::new();
544-
map.insert(1, 'a');
545-
map.insert(2, 'b');
546-
map.insert(3, 'c');
547-
let keys = map.keys().collect::<Vec<uint>>();
548-
assert_eq!(keys.len(), 3);
549-
assert!(keys.contains(&1));
550-
assert!(keys.contains(&2));
551-
assert!(keys.contains(&3));
552-
}
553-
554-
#[test]
555-
fn test_values() {
556-
let mut map = SmallIntMap::new();
557-
map.insert(1, 'a');
558-
map.insert(2, 'b');
559-
map.insert(3, 'c');
560-
let values = map.values().map(|&v| v).collect::<Vec<char>>();
561-
assert_eq!(values.len(), 3);
562-
assert!(values.contains(&'a'));
563-
assert!(values.contains(&'b'));
564-
assert!(values.contains(&'c'));
565-
}
566-
567520
#[test]
568521
fn test_iterator() {
569522
let mut m = SmallIntMap::new();

branches/auto/src/libcollections/treemap.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,6 @@ impl<K: Ord, V> TreeMap<K, V> {
141141
/// Create an empty TreeMap
142142
pub fn new() -> TreeMap<K, V> { TreeMap{root: None, length: 0} }
143143

144-
/// Get a lazy iterator over the keys in the map.
145-
pub fn keys<'a>(&'a self) -> Keys<'a, K, V> {
146-
self.iter().map(|(k, _v)| k)
147-
}
148-
149-
/// Get a lazy iterator over the values in the map.
150-
pub fn values<'a>(&'a self) -> Values<'a, K, V> {
151-
self.iter().map(|(_k, v)| v)
152-
}
153-
154144
/// Get a lazy iterator over the key-value pairs in the map.
155145
/// Requires that it be frozen (immutable).
156146
pub fn iter<'a>(&'a self) -> Entries<'a, K, V> {
@@ -391,15 +381,6 @@ pub struct RevMutEntries<'a, K, V> {
391381
}
392382

393383

394-
/// TreeMap keys iterator
395-
pub type Keys<'a, K, V> =
396-
iter::Map<'static, (&'a K, &'a V), &'a K, Entries<'a, K, V>>;
397-
398-
/// TreeMap values iterator
399-
pub type Values<'a, K, V> =
400-
iter::Map<'static, (&'a K, &'a V), &'a V, Entries<'a, K, V>>;
401-
402-
403384
// FIXME #5846 we want to be able to choose between &x and &mut x
404385
// (with many different `x`) below, so we need to optionally pass mut
405386
// as a tt, but the only thing we can do with a `tt` is pass them to
@@ -1489,28 +1470,6 @@ mod test_treemap {
14891470
assert!(m_upper.iter().all(|(_, &x)| x == 0));
14901471
}
14911472

1492-
#[test]
1493-
fn test_keys() {
1494-
let vec = vec![(1i, 'a'), (2i, 'b'), (3i, 'c')];
1495-
let map = vec.move_iter().collect::<TreeMap<int, char>>();
1496-
let keys = map.keys().map(|&k| k).collect::<Vec<int>>();
1497-
assert_eq!(keys.len(), 3);
1498-
assert!(keys.contains(&1));
1499-
assert!(keys.contains(&2));
1500-
assert!(keys.contains(&3));
1501-
}
1502-
1503-
#[test]
1504-
fn test_values() {
1505-
let vec = vec![(1i, 'a'), (2i, 'b'), (3i, 'c')];
1506-
let map = vec.move_iter().collect::<TreeMap<int, char>>();
1507-
let values = map.values().map(|&v| v).collect::<Vec<char>>();
1508-
assert_eq!(values.len(), 3);
1509-
assert!(values.contains(&'a'));
1510-
assert!(values.contains(&'b'));
1511-
assert!(values.contains(&'c'));
1512-
}
1513-
15141473
#[test]
15151474
fn test_eq() {
15161475
let mut a = TreeMap::new();

branches/auto/src/libcollections/trie.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use core::default::Default;
1818
use core::mem::zeroed;
1919
use core::mem;
2020
use core::uint;
21-
use core::iter;
2221
use std::hash::{Writer, Hash};
2322

2423
use {Collection, Mutable, Map, MutableMap, Set, MutableSet};
@@ -197,18 +196,6 @@ impl<T> TrieMap<T> {
197196
self.root.each_reverse(f)
198197
}
199198

200-
/// Get an iterator visiting all keys in ascending order by the keys.
201-
/// Iterator element type is `uint`.
202-
pub fn keys<'r>(&'r self) -> Keys<'r, T> {
203-
self.iter().map(|(k, _v)| k)
204-
}
205-
206-
/// Get an iterator visiting all values in ascending order by the keys.
207-
/// Iterator element type is `&'r T`.
208-
pub fn values<'r>(&'r self) -> Values<'r, T> {
209-
self.iter().map(|(_k, v)| v)
210-
}
211-
212199
/// Get an iterator over the key-value pairs in the map, ordered by keys.
213200
///
214201
/// # Example
@@ -796,14 +783,6 @@ pub struct MutEntries<'a, T> {
796783
remaining_max: uint
797784
}
798785

799-
/// Forward iterator over the keys of a map
800-
pub type Keys<'a, T> =
801-
iter::Map<'static, (uint, &'a T), uint, Entries<'a, T>>;
802-
803-
/// Forward iterator over the values of a map
804-
pub type Values<'a, T> =
805-
iter::Map<'static, (uint, &'a T), &'a T, Entries<'a, T>>;
806-
807786
// FIXME #5846: see `addr!` above.
808787
macro_rules! item { ($i:item) => {$i}}
809788

@@ -1091,28 +1070,6 @@ mod test_map {
10911070
}
10921071
}
10931072

1094-
#[test]
1095-
fn test_keys() {
1096-
let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')];
1097-
let map = vec.move_iter().collect::<TrieMap<char>>();
1098-
let keys = map.keys().collect::<Vec<uint>>();
1099-
assert_eq!(keys.len(), 3);
1100-
assert!(keys.contains(&1));
1101-
assert!(keys.contains(&2));
1102-
assert!(keys.contains(&3));
1103-
}
1104-
1105-
#[test]
1106-
fn test_values() {
1107-
let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')];
1108-
let map = vec.move_iter().collect::<TrieMap<char>>();
1109-
let values = map.values().map(|&v| v).collect::<Vec<char>>();
1110-
assert_eq!(values.len(), 3);
1111-
assert!(values.contains(&'a'));
1112-
assert!(values.contains(&'b'));
1113-
assert!(values.contains(&'c'));
1114-
}
1115-
11161073
#[test]
11171074
fn test_iteration() {
11181075
let empty_map : TrieMap<uint> = TrieMap::new();

branches/auto/src/libcore/fmt/num.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub struct Radix {
119119

120120
impl Radix {
121121
fn new(base: u8) -> Radix {
122-
assert!(2 <= base && base <= 36, "the base must be in the range of 0..36: {}", base);
122+
assert!(2 <= base && base <= 36, "the base must be in the range of 2..36: {}", base);
123123
Radix { base: base }
124124
}
125125
}

branches/auto/src/librustc/metadata/creader.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,16 +293,13 @@ fn existing_match(e: &Env, name: &str,
293293
// library. Even though an upstream library may have loaded something of
294294
// the same name, we have to make sure it was loaded from the exact same
295295
// location as well.
296-
//
297-
// We're also sure to compare *paths*, not actual byte slices. The
298-
// `source` stores paths which are normalized which may be different
299-
// from the strings on the command line.
300296
let source = e.sess.cstore.get_used_crate_source(cnum).unwrap();
297+
let dylib = source.dylib.as_ref().map(|p| p.as_vec());
298+
let rlib = source.rlib.as_ref().map(|p| p.as_vec());
301299
match e.sess.opts.externs.find_equiv(&name) {
302300
Some(locs) => {
303301
let found = locs.iter().any(|l| {
304-
let l = Some(Path::new(l.as_slice()));
305-
l == source.dylib || l == source.rlib
302+
Some(l.as_bytes()) == dylib || Some(l.as_bytes()) == rlib
306303
});
307304
if found {
308305
ret = Some(cnum);

branches/auto/src/librustc/middle/borrowck/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ pub fn check_crate(tcx: &ty::ctxt,
9898
}
9999

100100
fn make_stat(bccx: &BorrowckCtxt, stat: uint) -> String {
101+
let stat_f = stat as f64;
101102
let total = bccx.stats.guaranteed_paths.get() as f64;
102-
let perc = if total == 0.0 { 0.0 } else { stat as f64 * 100.0 / total };
103-
format!("{} ({:.0f}%)", stat, perc)
103+
format!("{} ({:.0f}%)", stat , stat_f * 100.0 / total)
104104
}
105105
}
106106

0 commit comments

Comments
 (0)