Skip to content

Commit b29e7ea

Browse files
committed
---
yaml --- r: 161595 b: refs/heads/snap-stage3 c: 558f8d8 h: refs/heads/master i: 161593: c203009 161591: c592ca2 v: v3
1 parent f0595b5 commit b29e7ea

Some content is hidden

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

95 files changed

+441
-274
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: 6e18b5af9336947ec5d41e66d216c52c12bf74a3
4+
refs/heads/snap-stage3: 558f8d8e3ea6b7da3d6d338740637149a7e45840
55
refs/heads/try: 0f0d21c1eb5c7be04d323e0b06faf252ad790af6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

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::{Some, None};
997+
use std::option::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::Some(1.0f64),
1008-
// std::option::None]);'
1007+
// Equivalent to 'foo(vec![std::option::Option::Some(1.0f64),
1008+
// std::option::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: 9 additions & 7 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::{Equal, Less, Greater};
295+
use core::cmp::Ordering::{Equal, Less, Greater};
296296
use core::slice::SlicePrelude;
297297
r.binary_search(|&(lo,hi)| {
298298
if lo <= c && c <= hi { Equal }
@@ -350,10 +350,11 @@ 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::{Equal, Less, Greater};
353+
use core::cmp::Ordering::{Equal, Less, Greater};
354354
use core::slice::SlicePrelude;
355355
use core::tuple::Tuple2;
356-
use core::option::{Option, Some, None};
356+
use core::option::Option;
357+
use core::option::Option::{Some, None};
357358
use core::slice;
358359
359360
pub fn to_lower(c: char) -> char {
@@ -403,7 +404,7 @@ def emit_grapheme_module(f, grapheme_table, grapheme_cats):
403404
f.write(""" }
404405
405406
fn bsearch_range_value_table(c: char, r: &'static [(char, char, GraphemeCat)]) -> GraphemeCat {
406-
use core::cmp::{Equal, Less, Greater};
407+
use core::cmp::Ordering::{Equal, Less, Greater};
407408
match r.binary_search(|&(lo, hi, _)| {
408409
if lo <= c && c <= hi { Equal }
409410
else if hi < c { Less }
@@ -430,12 +431,13 @@ def emit_grapheme_module(f, grapheme_table, grapheme_cats):
430431

431432
def emit_charwidth_module(f, width_table):
432433
f.write("pub mod charwidth {\n")
433-
f.write(" use core::option::{Option, Some, None};\n")
434+
f.write(" use core::option::Option;\n")
435+
f.write(" use core::option::Option::{Some, None};\n")
434436
f.write(" use core::slice::SlicePrelude;\n")
435437
f.write(" use core::slice;\n")
436438
f.write("""
437439
fn bsearch_range_value_table(c: char, is_cjk: bool, r: &'static [(char, char, u8, u8)]) -> u8 {
438-
use core::cmp::{Equal, Less, Greater};
440+
use core::cmp::Ordering::{Equal, Less, Greater};
439441
match r.binary_search(|&(lo, hi, _, _)| {
440442
if lo <= c && c <= hi { Equal }
441443
else if hi < c { Less }
@@ -530,7 +532,7 @@ def comp_pfun(char):
530532

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

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ 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::{Some, None, Option};
25+
use core::option::Option;
26+
use core::option::Option::{Some, None};
2627
use core::ptr::RawPtr;
2728
use core::ptr;
2829
use heap::deallocate;
@@ -326,7 +327,8 @@ mod tests {
326327
use std::comm::channel;
327328
use std::mem::drop;
328329
use std::ops::Drop;
329-
use std::option::{Option, Some, None};
330+
use std::option::Option;
331+
use std::option::Option::{Some, None};
330332
use std::str::Str;
331333
use std::sync::atomic;
332334
use std::task;

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

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

2425
/// A value that represents the global exchange heap. This is the default
2526
/// place that the `box` keyword allocates into when no place is supplied.

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

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

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

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,12 @@ 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, Some, None};
152+
use core::option::Option;
153+
use core::option::Option::{Some, None};
153154
use core::ptr;
154155
use core::ptr::RawPtr;
155-
use core::result::{Result, Ok, Err};
156+
use core::result::Result;
157+
use core::result::Result::{Ok, Err};
156158

157159
use heap::deallocate;
158160

@@ -739,8 +741,9 @@ impl<T> RcBoxPtr<T> for Weak<T> {
739741
mod tests {
740742
use super::{Rc, Weak, weak_count, strong_count};
741743
use std::cell::RefCell;
742-
use std::option::{Option, Some, None};
743-
use std::result::{Err, Ok};
744+
use std::option::Option;
745+
use std::option::Option::{Some, None};
746+
use std::result::Result::{Err, Ok};
744747
use std::mem::drop;
745748
use std::clone::Clone;
746749

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

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,26 +94,92 @@ impl<T> BTreeSet<T> {
9494

9595
impl<T: Ord> BTreeSet<T> {
9696
/// Visits the values representing the difference, in ascending order.
97+
///
98+
/// # Example
99+
///
100+
/// ```
101+
/// use std::collections::BTreeSet;
102+
///
103+
/// let mut a = BTreeSet::new();
104+
/// a.insert(1u);
105+
/// a.insert(2u);
106+
///
107+
/// let mut b = BTreeSet::new();
108+
/// b.insert(2u);
109+
/// b.insert(3u);
110+
///
111+
/// let diff: Vec<uint> = a.difference(&b).cloned().collect();
112+
/// assert_eq!(diff, vec![1u]);
113+
/// ```
97114
#[unstable = "matches collection reform specification, waiting for dust to settle"]
98115
pub fn difference<'a>(&'a self, other: &'a BTreeSet<T>) -> DifferenceItems<'a, T> {
99116
DifferenceItems{a: self.iter().peekable(), b: other.iter().peekable()}
100117
}
101118

102119
/// Visits the values representing the symmetric difference, in ascending order.
120+
///
121+
/// # Example
122+
///
123+
/// ```
124+
/// use std::collections::BTreeSet;
125+
///
126+
/// let mut a = BTreeSet::new();
127+
/// a.insert(1u);
128+
/// a.insert(2u);
129+
///
130+
/// let mut b = BTreeSet::new();
131+
/// b.insert(2u);
132+
/// b.insert(3u);
133+
///
134+
/// let sym_diff: Vec<uint> = a.symmetric_difference(&b).cloned().collect();
135+
/// assert_eq!(sym_diff, vec![1u,3]);
136+
/// ```
103137
#[unstable = "matches collection reform specification, waiting for dust to settle"]
104138
pub fn symmetric_difference<'a>(&'a self, other: &'a BTreeSet<T>)
105139
-> SymDifferenceItems<'a, T> {
106140
SymDifferenceItems{a: self.iter().peekable(), b: other.iter().peekable()}
107141
}
108142

109143
/// Visits the values representing the intersection, in ascending order.
144+
///
145+
/// # Example
146+
///
147+
/// ```
148+
/// use std::collections::BTreeSet;
149+
///
150+
/// let mut a = BTreeSet::new();
151+
/// a.insert(1u);
152+
/// a.insert(2u);
153+
///
154+
/// let mut b = BTreeSet::new();
155+
/// b.insert(2u);
156+
/// b.insert(3u);
157+
///
158+
/// let intersection: Vec<uint> = a.intersection(&b).cloned().collect();
159+
/// assert_eq!(intersection, vec![2u]);
160+
/// ```
110161
#[unstable = "matches collection reform specification, waiting for dust to settle"]
111162
pub fn intersection<'a>(&'a self, other: &'a BTreeSet<T>)
112163
-> IntersectionItems<'a, T> {
113164
IntersectionItems{a: self.iter().peekable(), b: other.iter().peekable()}
114165
}
115166

116167
/// Visits the values representing the union, in ascending order.
168+
///
169+
/// # Example
170+
///
171+
/// ```
172+
/// use std::collections::BTreeSet;
173+
///
174+
/// let mut a = BTreeSet::new();
175+
/// a.insert(1u);
176+
///
177+
/// let mut b = BTreeSet::new();
178+
/// b.insert(2u);
179+
///
180+
/// let union: Vec<uint> = a.union(&b).cloned().collect();
181+
/// assert_eq!(union, vec![1u,2]);
182+
/// ```
117183
#[unstable = "matches collection reform specification, waiting for dust to settle"]
118184
pub fn union<'a>(&'a self, other: &'a BTreeSet<T>) -> UnionItems<'a, T> {
119185
UnionItems{a: self.iter().peekable(), b: other.iter().peekable()}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,8 +833,10 @@ mod tests {
833833
use std::default::Default;
834834
use std::char::Char;
835835
use std::clone::Clone;
836-
use std::cmp::{Equal, Greater, Less, Ord, PartialOrd, Equiv};
837-
use std::option::{Some, None};
836+
use std::cmp::{Ord, PartialOrd, Equiv};
837+
use std::cmp::Ordering::{Equal, Greater, Less};
838+
use std::option::Option;
839+
use std::option::Option::{Some, None};
838840
use std::ptr::RawPtr;
839841
use std::iter::{Iterator, IteratorExt, DoubleEndedIteratorExt};
840842

branches/snap-stage3/src/libcore/any.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272
#![stable]
7373

7474
use mem::{transmute};
75-
use option::{Option, Some, None};
75+
use option::Option;
76+
use option::Option::{Some, None};
7677
use raw::TraitObject;
7778
use intrinsics::TypeId;
7879

branches/snap-stage3/src/libcore/cell.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ use cmp::PartialEq;
160160
use default::Default;
161161
use kinds::{marker, Copy};
162162
use ops::{Deref, DerefMut, Drop};
163-
use option::{None, Option, Some};
163+
use option::Option;
164+
use option::Option::{None, Some};
164165

165166
/// A mutable memory location that admits only `Copy` data.
166167
#[unstable = "likely to be renamed; otherwise stable"]

branches/snap-stage3/src/libcore/char.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#![doc(primitive = "char")]
1717

1818
use mem::transmute;
19-
use option::{None, Option, Some};
19+
use option::Option;
20+
use option::Option::{None, Some};
2021
use iter::{range_step, Iterator, RangeStep};
2122
use slice::SlicePrelude;
2223

branches/snap-stage3/src/libcore/cmp.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
pub use self::Ordering::*;
4545

4646
use kinds::Sized;
47-
use option::{Option, Some, None};
47+
use option::Option;
48+
use option::Option::{Some, None};
4849

4950
/// Trait for values that can be compared for equality and inequality.
5051
///
@@ -288,10 +289,11 @@ pub fn partial_max<T: PartialOrd>(v1: T, v2: T) -> Option<T> {
288289

289290
// Implementation of PartialEq, Eq, PartialOrd and Ord for primitive types
290291
mod impls {
291-
use cmp::{PartialOrd, Ord, PartialEq, Eq, Ordering,
292-
Less, Greater, Equal};
292+
use cmp::{PartialOrd, Ord, PartialEq, Eq, Ordering};
293+
use cmp::Ordering::{Less, Greater, Equal};
293294
use kinds::Sized;
294-
use option::{Option, Some, None};
295+
use option::Option;
296+
use option::Option::{Some, None};
295297

296298
macro_rules! partial_eq_impl(
297299
($($t:ty)*) => ($(

branches/snap-stage3/src/libcore/fmt/float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use fmt;
2020
use iter::{range, DoubleEndedIteratorExt};
2121
use num::{Float, FPNaN, FPInfinite, ToPrimitive};
2222
use num::cast;
23-
use result::Ok;
23+
use result::Result::Ok;
2424
use slice::{mod, SlicePrelude};
2525
use str::StrPrelude;
2626

branches/snap-stage3/src/libcore/fmt/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ use cell::{Cell, Ref, RefMut};
1717
use iter::{Iterator, IteratorExt, range};
1818
use kinds::{Copy, Sized};
1919
use mem;
20-
use option::{Option, Some, None};
20+
use option::Option;
21+
use option::Option::{Some, None};
2122
use ops::Deref;
22-
use result::{Ok, Err};
23+
use result::Result::{Ok, Err};
2324
use result;
2425
use slice::SlicePrelude;
2526
use slice;

branches/snap-stage3/src/libcore/iter.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ use cmp::Ord;
6262
use mem;
6363
use num::{ToPrimitive, Int};
6464
use ops::{Add, Deref};
65-
use option::{Option, Some, None};
65+
use option::Option;
66+
use option::Option::{Some, None};
6667
use uint;
6768

6869
#[deprecated = "renamed to Extend"] pub use self::Extend as Extendable;
@@ -2458,7 +2459,9 @@ pub fn repeat<T: Clone>(elt: T) -> Repeat<T> {
24582459
pub mod order {
24592460
use cmp;
24602461
use cmp::{Eq, Ord, PartialOrd, PartialEq};
2461-
use option::{Option, Some, None};
2462+
use cmp::Ordering::{Equal, Less, Greater};
2463+
use option::Option;
2464+
use option::Option::{Some, None};
24622465
use super::Iterator;
24632466

24642467
/// Compare `a` and `b` for equality using `Eq`
@@ -2476,11 +2479,11 @@ pub mod order {
24762479
pub fn cmp<A: Ord, T: Iterator<A>, S: Iterator<A>>(mut a: T, mut b: S) -> cmp::Ordering {
24772480
loop {
24782481
match (a.next(), b.next()) {
2479-
(None, None) => return cmp::Equal,
2480-
(None, _ ) => return cmp::Less,
2481-
(_ , None) => return cmp::Greater,
2482+
(None, None) => return Equal,
2483+
(None, _ ) => return Less,
2484+
(_ , None) => return Greater,
24822485
(Some(x), Some(y)) => match x.cmp(&y) {
2483-
cmp::Equal => (),
2486+
Equal => (),
24842487
non_eq => return non_eq,
24852488
},
24862489
}
@@ -2492,11 +2495,11 @@ pub mod order {
24922495
-> Option<cmp::Ordering> {
24932496
loop {
24942497
match (a.next(), b.next()) {
2495-
(None, None) => return Some(cmp::Equal),
2496-
(None, _ ) => return Some(cmp::Less),
2497-
(_ , None) => return Some(cmp::Greater),
2498+
(None, None) => return Some(Equal),
2499+
(None, _ ) => return Some(Less),
2500+
(_ , None) => return Some(Greater),
24982501
(Some(x), Some(y)) => match x.partial_cmp(&y) {
2499-
Some(cmp::Equal) => (),
2502+
Some(Equal) => (),
25002503
non_eq => return non_eq,
25012504
},
25022505
}

branches/snap-stage3/src/libcore/num/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ use kinds::Copy;
3030
use mem::size_of;
3131
use ops::{Add, Sub, Mul, Div, Rem, Neg};
3232
use ops::{Not, BitAnd, BitOr, BitXor, Shl, Shr};
33-
use option::{Option, Some, None};
33+
use option::Option;
34+
use option::Option::{Some, None};
3435
use str::{FromStr, from_str, StrPrelude};
3536

3637
/// Simultaneous division and remainder

0 commit comments

Comments
 (0)