Skip to content

Commit 0a136d5

Browse files
committed
---
yaml --- r: 161635 b: refs/heads/snap-stage3 c: 83a44c7 h: refs/heads/master i: 161633: 8ef8686 161631: e6207f8 v: v3
1 parent 155fe02 commit 0a136d5

Some content is hidden

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

99 files changed

+669
-280
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: 1fea900de7f11d665086141806246842c03b9fc5
4+
refs/heads/snap-stage3: 83a44c7fa676b4e5e546ce3d4624e585f9a1e899
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

0 commit comments

Comments
 (0)