Skip to content

Commit 909b8dd

Browse files
committed
---
yaml --- r: 127831 b: refs/heads/auto c: 68cbd6c h: refs/heads/master i: 127829: 31363b1 127827: 2146314 127823: ff5f0a1 v: v3
1 parent 0bdaf0f commit 909b8dd

File tree

24 files changed

+120
-343
lines changed

24 files changed

+120
-343
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: c7d0b5259d95ab4ef821bdf93a434538c3a84dad
16+
refs/heads/auto: 68cbd6c9294cadd7ff868be0bd756fcde84d757d
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libcollections/ringbuf.rs

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ impl<T> RingBuf<T> {
139139
/// # Example
140140
///
141141
/// ```rust
142-
/// #![allow(deprecated)]
143-
///
144142
/// use std::collections::RingBuf;
145143
///
146144
/// let mut buf = RingBuf::new();
@@ -149,7 +147,6 @@ impl<T> RingBuf<T> {
149147
/// buf.push(5);
150148
/// assert_eq!(buf.get(1), &4);
151149
/// ```
152-
#[deprecated = "prefer using indexing, e.g., ringbuf[0]"]
153150
pub fn get<'a>(&'a self, i: uint) -> &'a T {
154151
let idx = self.raw_index(i);
155152
match *self.elts.get(idx) {
@@ -172,7 +169,7 @@ impl<T> RingBuf<T> {
172169
/// buf.push(4);
173170
/// buf.push(5);
174171
/// *buf.get_mut(1) = 7;
175-
/// assert_eq!(buf[1], 7);
172+
/// assert_eq!(buf.get(1), &7);
176173
/// ```
177174
pub fn get_mut<'a>(&'a mut self, i: uint) -> &'a mut T {
178175
let idx = self.raw_index(i);
@@ -198,8 +195,8 @@ impl<T> RingBuf<T> {
198195
/// buf.push(4);
199196
/// buf.push(5);
200197
/// buf.swap(0, 2);
201-
/// assert_eq!(buf[0], 5);
202-
/// assert_eq!(buf[2], 3);
198+
/// assert_eq!(buf.get(0), &5);
199+
/// assert_eq!(buf.get(2), &3);
203200
/// ```
204201
pub fn swap(&mut self, i: uint, j: uint) {
205202
assert!(i < self.len());
@@ -479,21 +476,6 @@ impl<S: Writer, A: Hash<S>> Hash<S> for RingBuf<A> {
479476
}
480477
}
481478

482-
impl<A> Index<uint, A> for RingBuf<A> {
483-
#[inline]
484-
fn index<'a>(&'a self, i: &uint) -> &'a A {
485-
self.get(*i)
486-
}
487-
}
488-
489-
// FIXME(#12825) Indexing will always try IndexMut first and that causes issues.
490-
/*impl<A> IndexMut<uint, A> for RingBuf<A> {
491-
#[inline]
492-
fn index_mut<'a>(&'a mut self, index: &uint) -> &'a mut A {
493-
self.get_mut(*index)
494-
}
495-
}*/
496-
497479
impl<A> FromIterator<A> for RingBuf<A> {
498480
fn from_iter<T: Iterator<A>>(iterator: T) -> RingBuf<A> {
499481
let (lower, _) = iterator.size_hint();
@@ -671,25 +653,6 @@ mod tests {
671653
}
672654
}
673655

674-
#[test]
675-
fn test_index() {
676-
let mut deq = RingBuf::new();
677-
for i in range(1u, 4) {
678-
deq.push_front(i);
679-
}
680-
assert_eq!(deq[1], 2);
681-
}
682-
683-
#[test]
684-
#[should_fail]
685-
fn test_index_out_of_bounds() {
686-
let mut deq = RingBuf::new();
687-
for i in range(1u, 4) {
688-
deq.push_front(i);
689-
}
690-
deq[3];
691-
}
692-
693656
#[bench]
694657
fn bench_new(b: &mut test::Bencher) {
695658
b.iter(|| {

branches/auto/src/libcollections/smallintmap.rs

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,12 @@ impl<V> SmallIntMap<V> {
209209
/// # Example
210210
///
211211
/// ```
212-
/// #![allow(deprecated)]
213-
///
214212
/// use std::collections::SmallIntMap;
215213
///
216214
/// let mut map = SmallIntMap::new();
217215
/// map.insert(1, "a");
218216
/// assert_eq!(map.get(&1), &"a");
219217
/// ```
220-
#[deprecated = "prefer using indexing, e.g., map[0]"]
221218
pub fn get<'a>(&'a self, key: &uint) -> &'a V {
222219
self.find(key).expect("key not present")
223220
}
@@ -333,11 +330,11 @@ impl<V:Clone> SmallIntMap<V> {
333330
///
334331
/// // Key does not exist, will do a simple insert
335332
/// assert!(map.update(1, vec![1i, 2], |old, new| old.append(new.as_slice())));
336-
/// assert_eq!(map[1], vec![1i, 2]);
333+
/// assert_eq!(map.get(&1), &vec![1i, 2]);
337334
///
338335
/// // Key exists, update the value
339336
/// assert!(!map.update(1, vec![3i, 4], |old, new| old.append(new.as_slice())));
340-
/// assert_eq!(map[1], vec![1i, 2, 3, 4]);
337+
/// assert_eq!(map.get(&1), &vec![1i, 2, 3, 4]);
341338
/// ```
342339
pub fn update(&mut self, key: uint, newval: V, ff: |V, V| -> V) -> bool {
343340
self.update_with_key(key, newval, |_k, v, v1| ff(v,v1))
@@ -357,11 +354,11 @@ impl<V:Clone> SmallIntMap<V> {
357354
///
358355
/// // Key does not exist, will do a simple insert
359356
/// assert!(map.update_with_key(7, 10, |key, old, new| (old + new) % key));
360-
/// assert_eq!(map[7], 10);
357+
/// assert_eq!(map.get(&7), &10);
361358
///
362359
/// // Key exists, update the value
363360
/// assert!(!map.update_with_key(7, 20, |key, old, new| (old + new) % key));
364-
/// assert_eq!(map[7], 2);
361+
/// assert_eq!(map.get(&7), &2);
365362
/// ```
366363
pub fn update_with_key(&mut self,
367364
key: uint,
@@ -419,21 +416,6 @@ impl<V> Extendable<(uint, V)> for SmallIntMap<V> {
419416
}
420417
}
421418

422-
impl<V> Index<uint, V> for SmallIntMap<V> {
423-
#[inline]
424-
fn index<'a>(&'a self, i: &uint) -> &'a V {
425-
self.get(i)
426-
}
427-
}
428-
429-
// FIXME(#12825) Indexing will always try IndexMut first and that causes issues.
430-
/*impl<V> IndexMut<uint, V> for SmallIntMap<V> {
431-
#[inline]
432-
fn index_mut<'a>(&'a mut self, i: &uint) -> &'a mut V {
433-
self.find_mut(i).expect("key not present")
434-
}
435-
}*/
436-
437419
macro_rules! iterator {
438420
(impl $name:ident -> $elem:ty, $getter:ident) => {
439421
impl<'a, T> Iterator<$elem> for $name<'a, T> {
@@ -861,29 +843,6 @@ mod test_map {
861843
assert_eq!(map.find(&k), Some(&v));
862844
}
863845
}
864-
865-
#[test]
866-
fn test_index() {
867-
let mut map: SmallIntMap<int> = SmallIntMap::new();
868-
869-
map.insert(1, 2);
870-
map.insert(2, 1);
871-
map.insert(3, 4);
872-
873-
assert_eq!(map[3], 4);
874-
}
875-
876-
#[test]
877-
#[should_fail]
878-
fn test_index_nonexistent() {
879-
let mut map: SmallIntMap<int> = SmallIntMap::new();
880-
881-
map.insert(1, 2);
882-
map.insert(2, 1);
883-
map.insert(3, 4);
884-
885-
map[4];
886-
}
887846
}
888847

889848
#[cfg(test)]

branches/auto/src/libcollections/treemap.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -246,20 +246,6 @@ impl<K: Ord, V> Default for TreeMap<K,V> {
246246
fn default() -> TreeMap<K, V> { TreeMap::new() }
247247
}
248248

249-
impl<K: Ord, V> Index<K, V> for TreeMap<K, V> {
250-
#[inline]
251-
fn index<'a>(&'a self, i: &K) -> &'a V {
252-
self.find(i).expect("no entry found for key")
253-
}
254-
}
255-
256-
/*impl<K: Ord, V> IndexMut<K, V> for TreeMap<K, V> {
257-
#[inline]
258-
fn index_mut<'a>(&'a mut self, i: &K) -> &'a mut V {
259-
self.find_mut(i).expect("no entry found for key")
260-
}
261-
}*/
262-
263249
impl<K: Ord, V> TreeMap<K, V> {
264250
/// Create an empty `TreeMap`.
265251
///
@@ -2163,28 +2149,6 @@ mod test_treemap {
21632149
}
21642150
}
21652151

2166-
#[test]
2167-
fn test_index() {
2168-
let mut map: TreeMap<int, int> = TreeMap::new();
2169-
2170-
map.insert(1, 2);
2171-
map.insert(2, 1);
2172-
map.insert(3, 4);
2173-
2174-
assert_eq!(map[2], 1);
2175-
}
2176-
2177-
#[test]
2178-
#[should_fail]
2179-
fn test_index_nonexistent() {
2180-
let mut map: TreeMap<int, int> = TreeMap::new();
2181-
2182-
map.insert(1, 2);
2183-
map.insert(2, 1);
2184-
map.insert(3, 4);
2185-
2186-
map[4];
2187-
}
21882152
}
21892153

21902154
#[cfg(test)]

branches/auto/src/libcollections/trie.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -502,21 +502,6 @@ impl<S: Writer, T: Hash<S>> Hash<S> for TrieMap<T> {
502502
}
503503
}
504504

505-
impl<T> Index<uint, T> for TrieMap<T> {
506-
#[inline]
507-
fn index<'a>(&'a self, i: &uint) -> &'a T {
508-
self.find(i).expect("key not present")
509-
}
510-
}
511-
512-
// FIXME(#12825) Indexing will always try IndexMut first and that causes issues.
513-
/*impl<T> IndexMut<uint, T> for TrieMap<T> {
514-
#[inline]
515-
fn index_mut<'a>(&'a mut self, i: &uint) -> &'a mut T {
516-
self.find_mut(i).expect("key not present")
517-
}
518-
}*/
519-
520505
/// A set implemented as a radix trie.
521506
///
522507
/// # Example
@@ -1406,29 +1391,6 @@ mod test_map {
14061391
assert!(map_str == "{1: a, 2: b}".to_string());
14071392
assert_eq!(format!("{}", empty), "{}".to_string());
14081393
}
1409-
1410-
#[test]
1411-
fn test_index() {
1412-
let mut map = TrieMap::new();
1413-
1414-
map.insert(1, 2i);
1415-
map.insert(2, 1i);
1416-
map.insert(3, 4i);
1417-
1418-
assert_eq!(map[2], 1);
1419-
}
1420-
1421-
#[test]
1422-
#[should_fail]
1423-
fn test_index_nonexistent() {
1424-
let mut map = TrieMap::new();
1425-
1426-
map.insert(1, 2i);
1427-
map.insert(2, 1i);
1428-
map.insert(3, 4i);
1429-
1430-
map[4];
1431-
}
14321394
}
14331395

14341396
#[cfg(test)]

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use collections::Collection;
1919
use iter::{Iterator, range};
2020
use kinds::Copy;
2121
use mem;
22-
use num::Float;
2322
use option::{Option, Some, None};
2423
use ops::Deref;
2524
use result::{Ok, Err};
@@ -585,7 +584,7 @@ macro_rules! floating(($ty:ident) => {
585584
float::ExpNone,
586585
false,
587586
|bytes| {
588-
fmt.pad_integral(self.is_nan() || *self >= 0.0, "", bytes)
587+
fmt.pad_integral(*self >= 0.0, "", bytes)
589588
})
590589
}
591590
}
@@ -606,7 +605,7 @@ macro_rules! floating(($ty:ident) => {
606605
float::ExpDec,
607606
false,
608607
|bytes| {
609-
fmt.pad_integral(self.is_nan() || *self >= 0.0, "", bytes)
608+
fmt.pad_integral(*self >= 0.0, "", bytes)
610609
})
611610
}
612611
}
@@ -627,7 +626,7 @@ macro_rules! floating(($ty:ident) => {
627626
float::ExpDec,
628627
true,
629628
|bytes| {
630-
fmt.pad_integral(self.is_nan() || *self >= 0.0, "", bytes)
629+
fmt.pad_integral(*self >= 0.0, "", bytes)
631630
})
632631
}
633632
}

branches/auto/src/libnative/io/process.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,7 @@ fn make_command_line(prog: &CString, args: &[CString]) -> String {
479479
return cmd;
480480

481481
fn append_arg(cmd: &mut String, arg: &str) {
482-
// If an argument has 0 characters then we need to quote it to ensure
483-
// that it actually gets passed through on the command line or otherwise
484-
// it will be dropped entirely when parsed on the other end.
485-
let quote = arg.chars().any(|c| c == ' ' || c == '\t') || arg.len() == 0;
482+
let quote = arg.chars().any(|c| c == ' ' || c == '\t');
486483
if quote {
487484
cmd.push_char('"');
488485
}

0 commit comments

Comments
 (0)