Skip to content

Commit d3d1e5e

Browse files
committed
---
yaml --- r: 161642 b: refs/heads/snap-stage3 c: 616af6e h: refs/heads/master v: v3
1 parent d13fbea commit d3d1e5e

File tree

191 files changed

+1471
-1726
lines changed

Some content is hidden

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

191 files changed

+1471
-1726
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: 4eb72d268f337a8f117c86a2ac1b98336cab9e9d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: cf0b4e068227dd33fa15f3ffe24f29e0535d197f
4+
refs/heads/snap-stage3: 616af6eb83630b76bb3a9bde57a00f5ebe5dbd6c
55
refs/heads/try: 0f0d21c1eb5c7be04d323e0b06faf252ad790af6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
346346
desc: test::TestDesc {
347347
name: make_test_name(config, testfile),
348348
ignore: header::is_test_ignored(config, testfile),
349-
should_fail: false
349+
should_fail: test::ShouldFail::No,
350350
},
351351
testfn: f(),
352352
}

branches/snap-stage3/src/doc/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ An example of `use` declarations:
994994

995995
```
996996
use std::iter::range_step;
997-
use std::option::Option::{Some, None};
997+
use std::option::{Some, None};
998998
use std::collections::hash_map::{mod, HashMap};
999999
10001000
fn foo<T>(_: T){}
@@ -1004,8 +1004,8 @@ fn main() {
10041004
// Equivalent to 'std::iter::range_step(0u, 10u, 2u);'
10051005
range_step(0u, 10u, 2u);
10061006
1007-
// Equivalent to 'foo(vec![std::option::Option::Some(1.0f64),
1008-
// std::option::Option::None]);'
1007+
// Equivalent to 'foo(vec![std::option::Some(1.0f64),
1008+
// std::option::None]);'
10091009
foo(vec![Some(1.0f64), None]);
10101010
10111011
// Both `hash_map` and `HashMap` are in scope.

branches/snap-stage3/src/etc/unicode.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def escape_char(c):
292292
def emit_bsearch_range_table(f):
293293
f.write("""
294294
fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool {
295-
use core::cmp::Ordering::{Equal, Less, Greater};
295+
use core::cmp::{Equal, Less, Greater};
296296
use core::slice::SlicePrelude;
297297
r.binary_search(|&(lo,hi)| {
298298
if lo <= c && c <= hi { Equal }
@@ -350,11 +350,10 @@ def emit_regex_module(f, cats, w_data):
350350
def emit_conversions_module(f, lowerupper, upperlower):
351351
f.write("pub mod conversions {")
352352
f.write("""
353-
use core::cmp::Ordering::{Equal, Less, Greater};
353+
use core::cmp::{Equal, Less, Greater};
354354
use core::slice::SlicePrelude;
355355
use core::tuple::Tuple2;
356-
use core::option::Option;
357-
use core::option::Option::{Some, None};
356+
use core::option::{Option, Some, None};
358357
use core::slice;
359358
360359
pub fn to_lower(c: char) -> char {
@@ -404,7 +403,7 @@ def emit_grapheme_module(f, grapheme_table, grapheme_cats):
404403
f.write(""" }
405404
406405
fn bsearch_range_value_table(c: char, r: &'static [(char, char, GraphemeCat)]) -> GraphemeCat {
407-
use core::cmp::Ordering::{Equal, Less, Greater};
406+
use core::cmp::{Equal, Less, Greater};
408407
match r.binary_search(|&(lo, hi, _)| {
409408
if lo <= c && c <= hi { Equal }
410409
else if hi < c { Less }
@@ -431,13 +430,12 @@ def emit_grapheme_module(f, grapheme_table, grapheme_cats):
431430

432431
def emit_charwidth_module(f, width_table):
433432
f.write("pub mod charwidth {\n")
434-
f.write(" use core::option::Option;\n")
435-
f.write(" use core::option::Option::{Some, None};\n")
433+
f.write(" use core::option::{Option, Some, None};\n")
436434
f.write(" use core::slice::SlicePrelude;\n")
437435
f.write(" use core::slice;\n")
438436
f.write("""
439437
fn bsearch_range_value_table(c: char, is_cjk: bool, r: &'static [(char, char, u8, u8)]) -> u8 {
440-
use core::cmp::Ordering::{Equal, Less, Greater};
438+
use core::cmp::{Equal, Less, Greater};
441439
match r.binary_search(|&(lo, hi, _, _)| {
442440
if lo <= c && c <= hi { Equal }
443441
else if hi < c { Less }
@@ -532,7 +530,7 @@ def comp_pfun(char):
532530

533531
f.write("""
534532
fn bsearch_range_value_table(c: char, r: &'static [(char, char, u8)]) -> u8 {
535-
use core::cmp::Ordering::{Equal, Less, Greater};
533+
use core::cmp::{Equal, Less, Greater};
536534
use core::slice::SlicePrelude;
537535
use core::slice;
538536
match r.binary_search(|&(lo, hi, _)| {

branches/snap-stage3/src/liballoc/arc.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ use core::kinds::{Sync, Send};
2222
use core::mem::{min_align_of, size_of, drop};
2323
use core::mem;
2424
use core::ops::{Drop, Deref};
25-
use core::option::Option;
26-
use core::option::Option::{Some, None};
25+
use core::option::{Some, None, Option};
2726
use core::ptr::RawPtr;
2827
use core::ptr;
2928
use heap::deallocate;
@@ -327,8 +326,7 @@ mod tests {
327326
use std::comm::channel;
328327
use std::mem::drop;
329328
use std::ops::Drop;
330-
use std::option::Option;
331-
use std::option::Option::{Some, None};
329+
use std::option::{Option, Some, None};
332330
use std::str::Str;
333331
use std::sync::atomic;
334332
use std::task;
@@ -523,7 +521,7 @@ mod tests {
523521
#[test]
524522
fn show_arc() {
525523
let a = Arc::new(5u32);
526-
assert!(format!("{}", a) == "5")
524+
assert!(format!("{}", a).as_slice() == "5")
527525
}
528526

529527
// Make sure deriving works with Arc<T>

branches/snap-stage3/src/liballoc/boxed.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ use core::kinds::Sized;
1919
use core::mem;
2020
use core::option::Option;
2121
use core::raw::TraitObject;
22-
use core::result::Result;
23-
use core::result::Result::{Ok, Err};
22+
use core::result::{Ok, Err, Result};
2423

2524
/// A value that represents the global exchange heap. This is the default
2625
/// place that the `box` keyword allocates into when no place is supplied.
@@ -170,14 +169,14 @@ mod test {
170169
let b = box Test as Box<Any>;
171170
let a_str = a.to_str();
172171
let b_str = b.to_str();
173-
assert_eq!(a_str, "Box<Any>");
174-
assert_eq!(b_str, "Box<Any>");
172+
assert_eq!(a_str.as_slice(), "Box<Any>");
173+
assert_eq!(b_str.as_slice(), "Box<Any>");
175174

176175
let a = &8u as &Any;
177176
let b = &Test as &Any;
178177
let s = format!("{}", a);
179-
assert_eq!(s, "&Any");
178+
assert_eq!(s.as_slice(), "&Any");
180179
let s = format!("{}", b);
181-
assert_eq!(s, "&Any");
180+
assert_eq!(s.as_slice(), "&Any");
182181
}
183182
}

branches/snap-stage3/src/liballoc/heap.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ mod imp {
177177

178178
#[cfg(all(not(external_funcs), not(external_crate), jemalloc))]
179179
mod imp {
180-
use core::option::Option;
181-
use core::option::Option::None;
180+
use core::option::{None, Option};
182181
use core::ptr::{null_mut, null};
183182
use core::num::Int;
184183
use libc::{c_char, c_int, c_void, size_t};

branches/snap-stage3/src/liballoc/rc.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,10 @@ use core::fmt;
149149
use core::kinds::marker;
150150
use core::mem::{transmute, min_align_of, size_of, forget};
151151
use core::ops::{Deref, Drop};
152-
use core::option::Option;
153-
use core::option::Option::{Some, None};
152+
use core::option::{Option, Some, None};
154153
use core::ptr;
155154
use core::ptr::RawPtr;
156-
use core::result::Result;
157-
use core::result::Result::{Ok, Err};
155+
use core::result::{Result, Ok, Err};
158156

159157
use heap::deallocate;
160158

@@ -741,9 +739,8 @@ impl<T> RcBoxPtr<T> for Weak<T> {
741739
mod tests {
742740
use super::{Rc, Weak, weak_count, strong_count};
743741
use std::cell::RefCell;
744-
use std::option::Option;
745-
use std::option::Option::{Some, None};
746-
use std::result::Result::{Err, Ok};
742+
use std::option::{Option, Some, None};
743+
use std::result::{Err, Ok};
747744
use std::mem::drop;
748745
use std::clone::Clone;
749746

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ impl<T: Ord> BinaryHeap<T> {
485485
let mut end = q.len();
486486
while end > 1 {
487487
end -= 1;
488-
q.data.swap(0, end);
488+
q.data.as_mut_slice().swap(0, end);
489489
q.siftdown_range(0, end)
490490
}
491491
q.into_vec()
@@ -769,8 +769,8 @@ mod tests {
769769
v.sort();
770770
data.sort();
771771

772-
assert_eq!(v, data);
773-
assert_eq!(heap.into_sorted_vec(), data);
772+
assert_eq!(v.as_slice(), data.as_slice());
773+
assert_eq!(heap.into_sorted_vec().as_slice(), data.as_slice());
774774
}
775775

776776
#[test]
@@ -812,7 +812,7 @@ mod tests {
812812
fn test_from_iter() {
813813
let xs = vec!(9u, 8, 7, 6, 5, 4, 3, 2, 1);
814814

815-
let mut q: BinaryHeap<uint> = xs.iter().rev().map(|&x| x).collect();
815+
let mut q: BinaryHeap<uint> = xs.as_slice().iter().rev().map(|&x| x).collect();
816816

817817
for &x in xs.iter() {
818818
assert_eq!(q.pop().unwrap(), x);

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,10 +1692,10 @@ mod tests {
16921692
#[test]
16931693
fn test_to_str() {
16941694
let zerolen = Bitv::new();
1695-
assert_eq!(zerolen.to_string(), "");
1695+
assert_eq!(zerolen.to_string().as_slice(), "");
16961696

16971697
let eightbits = Bitv::with_capacity(8u, false);
1698-
assert_eq!(eightbits.to_string(), "00000000")
1698+
assert_eq!(eightbits.to_string().as_slice(), "00000000")
16991699
}
17001700

17011701
#[test]
@@ -1718,7 +1718,7 @@ mod tests {
17181718
let mut b = bitv::Bitv::with_capacity(2, false);
17191719
b.set(0, true);
17201720
b.set(1, false);
1721-
assert_eq!(b.to_string(), "10");
1721+
assert_eq!(b.to_string().as_slice(), "10");
17221722
}
17231723

17241724
#[test]
@@ -2029,7 +2029,7 @@ mod tests {
20292029
fn test_from_bytes() {
20302030
let bitv = from_bytes(&[0b10110110, 0b00000000, 0b11111111]);
20312031
let str = format!("{}{}{}", "10110110", "00000000", "11111111");
2032-
assert_eq!(bitv.to_string(), str);
2032+
assert_eq!(bitv.to_string().as_slice(), str.as_slice());
20332033
}
20342034

20352035
#[test]
@@ -2048,7 +2048,7 @@ mod tests {
20482048
fn test_from_bools() {
20492049
let bools = vec![true, false, true, true];
20502050
let bitv: Bitv = bools.iter().map(|n| *n).collect();
2051-
assert_eq!(bitv.to_string(), "1011");
2051+
assert_eq!(bitv.to_string().as_slice(), "1011");
20522052
}
20532053

20542054
#[test]
@@ -2207,7 +2207,7 @@ mod tests {
22072207

22082208
let expected = [3, 5, 11, 77];
22092209
let actual = a.intersection(&b).collect::<Vec<uint>>();
2210-
assert_eq!(actual, expected);
2210+
assert_eq!(actual.as_slice(), expected.as_slice());
22112211
}
22122212

22132213
#[test]
@@ -2226,7 +2226,7 @@ mod tests {
22262226

22272227
let expected = [1, 5, 500];
22282228
let actual = a.difference(&b).collect::<Vec<uint>>();
2229-
assert_eq!(actual, expected);
2229+
assert_eq!(actual.as_slice(), expected.as_slice());
22302230
}
22312231

22322232
#[test]
@@ -2247,7 +2247,7 @@ mod tests {
22472247

22482248
let expected = [1, 5, 11, 14, 220];
22492249
let actual = a.symmetric_difference(&b).collect::<Vec<uint>>();
2250-
assert_eq!(actual, expected);
2250+
assert_eq!(actual.as_slice(), expected.as_slice());
22512251
}
22522252

22532253
#[test]
@@ -2272,7 +2272,7 @@ mod tests {
22722272

22732273
let expected = [1, 3, 5, 9, 11, 13, 19, 24, 160, 200];
22742274
let actual = a.union(&b).collect::<Vec<uint>>();
2275-
assert_eq!(actual, expected);
2275+
assert_eq!(actual.as_slice(), expected.as_slice());
22762276
}
22772277

22782278
#[test]
@@ -2660,7 +2660,7 @@ mod tests {
26602660
s.insert(10);
26612661
s.insert(50);
26622662
s.insert(2);
2663-
assert_eq!("{1, 2, 10, 50}", s.to_string());
2663+
assert_eq!("{1, 2, 10, 50}".to_string(), s.to_string());
26642664
}
26652665

26662666
fn rng() -> rand::IsaacRng {

branches/snap-stage3/src/libcollections/btree/map.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,38 +1068,12 @@ impl<K, V> BTreeMap<K, V> {
10681068
}
10691069

10701070
/// Gets an iterator over the keys of the map.
1071-
///
1072-
/// # Example
1073-
///
1074-
/// ```
1075-
/// use std::collections::BTreeMap;
1076-
///
1077-
/// let mut a = BTreeMap::new();
1078-
/// a.insert(1u, "a");
1079-
/// a.insert(2u, "b");
1080-
///
1081-
/// let keys: Vec<uint> = a.keys().cloned().collect();
1082-
/// assert_eq!(keys, vec![1u,2,]);
1083-
/// ```
10841071
#[unstable = "matches collection reform specification, waiting for dust to settle"]
10851072
pub fn keys<'a>(&'a self) -> Keys<'a, K, V> {
10861073
self.iter().map(|(k, _)| k)
10871074
}
10881075

10891076
/// Gets an iterator over the values of the map.
1090-
///
1091-
/// # Example
1092-
///
1093-
/// ```
1094-
/// use std::collections::BTreeMap;
1095-
///
1096-
/// let mut a = BTreeMap::new();
1097-
/// a.insert(1u, "a");
1098-
/// a.insert(2u, "b");
1099-
///
1100-
/// let values: Vec<&str> = a.values().cloned().collect();
1101-
/// assert_eq!(values, vec!["a","b"]);
1102-
/// ```
11031077
#[unstable = "matches collection reform specification, waiting for dust to settle"]
11041078
pub fn values<'a>(&'a self) -> Values<'a, K, V> {
11051079
self.iter().map(|(_, v)| v)

0 commit comments

Comments
 (0)