Skip to content

Commit d6cf73b

Browse files
committed
---
yaml --- r: 158959 b: refs/heads/master c: 830c82d h: refs/heads/master i: 158957: 5c1eb04 158955: 5fae6b7 158951: 0f53400 158943: e248e20 v: v3
1 parent f8fbecc commit d6cf73b

File tree

140 files changed

+4858
-4427
lines changed

Some content is hidden

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

140 files changed

+4858
-4427
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 3961eaec85c34e96e170ac84f6058997e1c0dfea
2+
refs/heads/master: 830c82dd741b2d2a248515203a0f6a6662a0abe6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: f89e975685a3a9f258c996865cdd144a0f30f83c
55
refs/heads/try: f58aad6dce273570fb130b4df008ef9acd5a5be2

trunk/mk/cfg/i686-pc-windows-gnu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# i686-pc-windows-gnu configuration
2-
CROSS_PREFIX_i686-pc-windows-gnu=i686-pc-windows-gnu-
2+
CROSS_PREFIX_i686-pc-windows-gnu=i686-w64-mingw32-
33
CC_i686-pc-windows-gnu=gcc
44
CXX_i686-pc-windows-gnu=g++
55
CPP_i686-pc-windows-gnu=gcc -E

trunk/mk/cfg/x86_64-pc-windows-gnu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# x86_64-pc-windows-gnu configuration
2-
CROSS_PREFIX_x86_64-pc-windows-gnu=x86_64-pc-windows-gnu-
2+
CROSS_PREFIX_x86_64-pc-windows-gnu=x86_64-w64-mingw32-
33
CC_x86_64-pc-windows-gnu=gcc
44
CXX_x86_64-pc-windows-gnu=g++
55
CPP_x86_64-pc-windows-gnu=gcc -E

trunk/src/doc/guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ s.push_str(", world.");
14811481
println!("{}", s);
14821482
```
14831483

1484-
You can coerce a `String` into a `&str` with the `as_slice()` method:
1484+
You can get a `&str` view into a `String` with the `as_slice()` method:
14851485

14861486
```{rust}
14871487
fn takes_slice(slice: &str) {
@@ -1514,7 +1514,7 @@ fn compare(string: String) {
15141514
}
15151515
```
15161516

1517-
Converting a `String` to a `&str` is cheap, but converting the `&str` to a
1517+
Viewing a `String` as a `&str` is cheap, but converting the `&str` to a
15181518
`String` involves allocating memory. No reason to do that unless you have to!
15191519

15201520
That's the basics of strings in Rust! They're probably a bit more complicated

trunk/src/doc/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ including the right thing!) Even though we compiled with flags to give us as
217217
many warnings as possible, and to treat those warnings as errors, we got no
218218
errors. When we ran the program, it crashed.
219219

220-
Why does this happen? When we prepend to an array, its length changes. Since
220+
Why does this happen? When we append to an array, its length changes. Since
221221
its length changes, we may need to allocate more memory. In Ruby, this happens
222222
as well, we just don't think about it very often. So why does the C++ version
223223
segfault when we allocate more memory?

trunk/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ syn keyword rustEnum Ordering
9393
syn keyword rustEnumVariant Less Equal Greater
9494
syn keyword rustTrait Collection Mutable Map MutableMap MutableSeq
9595
syn keyword rustTrait Set MutableSet
96-
syn keyword rustTrait FromIterator Extendable ExactSize
96+
syn keyword rustTrait FromIterator IntoIterator Extend ExactSize
9797
syn keyword rustTrait Iterator DoubleEndedIterator
9898
syn keyword rustTrait RandomAccessIterator CloneableIterator
9999
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator

trunk/src/libcollections/binary_heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ impl<T: Ord> FromIterator<T> for BinaryHeap<T> {
555555
}
556556
}
557557

558-
impl<T: Ord> Extendable<T> for BinaryHeap<T> {
558+
impl<T: Ord> Extend<T> for BinaryHeap<T> {
559559
fn extend<Iter: Iterator<T>>(&mut self, mut iter: Iter) {
560560
let (lower, _) = iter.size_hint();
561561

trunk/src/libcollections/bit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ impl FromIterator<bool> for Bitv {
835835
}
836836
}
837837

838-
impl Extendable<bool> for Bitv {
838+
impl Extend<bool> for Bitv {
839839
#[inline]
840840
fn extend<I: Iterator<bool>>(&mut self, mut iterator: I) {
841841
let (min, _) = iterator.size_hint();
@@ -1014,7 +1014,7 @@ impl FromIterator<bool> for BitvSet {
10141014
}
10151015
}
10161016

1017-
impl Extendable<bool> for BitvSet {
1017+
impl Extend<bool> for BitvSet {
10181018
#[inline]
10191019
fn extend<I: Iterator<bool>>(&mut self, iterator: I) {
10201020
let &BitvSet(ref mut self_bitv) = self;

trunk/src/libcollections/btree/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ impl<K: Ord, V> FromIterator<(K, V)> for BTreeMap<K, V> {
727727
}
728728
}
729729

730-
impl<K: Ord, V> Extendable<(K, V)> for BTreeMap<K, V> {
730+
impl<K: Ord, V> Extend<(K, V)> for BTreeMap<K, V> {
731731
#[inline]
732732
fn extend<T: Iterator<(K, V)>>(&mut self, mut iter: T) {
733733
for (k, v) in iter {

trunk/src/libcollections/btree/set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ impl<T: Ord> FromIterator<T> for BTreeSet<T> {
316316
}
317317
}
318318

319-
impl<T: Ord> Extendable<T> for BTreeSet<T> {
319+
impl<T: Ord> Extend<T> for BTreeSet<T> {
320320
#[inline]
321321
fn extend<Iter: Iterator<T>>(&mut self, mut iter: Iter) {
322322
for elem in iter {

trunk/src/libcollections/dlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ impl<A> FromIterator<A> for DList<A> {
720720
}
721721
}
722722

723-
impl<A> Extendable<A> for DList<A> {
723+
impl<A> Extend<A> for DList<A> {
724724
fn extend<T: Iterator<A>>(&mut self, mut iterator: T) {
725725
for elt in iterator { self.push_back(elt); }
726726
}

trunk/src/libcollections/enum_set.rs

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use core::prelude::*;
1717
use core::fmt;
1818

19-
// FIXME(conventions): implement BitXor
2019
// FIXME(contentions): implement union family of methods? (general design may be wrong here)
2120

2221
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
@@ -201,6 +200,12 @@ impl<E:CLike> BitAnd<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
201200
}
202201
}
203202

203+
impl<E:CLike> BitXor<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
204+
fn bitxor(&self, e: &EnumSet<E>) -> EnumSet<E> {
205+
EnumSet {bits: self.bits ^ e.bits}
206+
}
207+
}
208+
204209
/// An iterator over an EnumSet
205210
pub struct Items<E> {
206211
index: uint,
@@ -235,6 +240,22 @@ impl<E:CLike> Iterator<E> for Items<E> {
235240
}
236241
}
237242

243+
impl<E:CLike> FromIterator<E> for EnumSet<E> {
244+
fn from_iter<I:Iterator<E>>(iterator: I) -> EnumSet<E> {
245+
let mut ret = EnumSet::new();
246+
ret.extend(iterator);
247+
ret
248+
}
249+
}
250+
251+
impl<E:CLike> Extend<E> for EnumSet<E> {
252+
fn extend<I: Iterator<E>>(&mut self, mut iterator: I) {
253+
for element in iterator {
254+
self.insert(element);
255+
}
256+
}
257+
}
258+
238259
#[cfg(test)]
239260
mod test {
240261
use std::prelude::*;
@@ -417,9 +438,29 @@ mod test {
417438
let elems = e_intersection.iter().collect();
418439
assert_eq!(vec![C], elems)
419440

441+
// Another way to express intersection
442+
let e_intersection = e1 - (e1 - e2);
443+
let elems = e_intersection.iter().collect();
444+
assert_eq!(vec![C], elems)
445+
420446
let e_subtract = e1 - e2;
421447
let elems = e_subtract.iter().collect();
422448
assert_eq!(vec![A], elems)
449+
450+
// Bitwise XOR of two sets, aka symmetric difference
451+
let e_symmetric_diff = e1 ^ e2;
452+
let elems = e_symmetric_diff.iter().collect();
453+
assert_eq!(vec![A,B], elems)
454+
455+
// Another way to express symmetric difference
456+
let e_symmetric_diff = (e1 - e2) | (e2 - e1);
457+
let elems = e_symmetric_diff.iter().collect();
458+
assert_eq!(vec![A,B], elems)
459+
460+
// Yet another way to express symmetric difference
461+
let e_symmetric_diff = (e1 | e2) - (e1 & e2);
462+
let elems = e_symmetric_diff.iter().collect();
463+
assert_eq!(vec![A,B], elems)
423464
}
424465

425466
#[test]

trunk/src/libcollections/ring_buf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ impl<A> FromIterator<A> for RingBuf<A> {
735735
}
736736
}
737737

738-
impl<A> Extendable<A> for RingBuf<A> {
738+
impl<A> Extend<A> for RingBuf<A> {
739739
fn extend<T: Iterator<A>>(&mut self, mut iterator: T) {
740740
for elt in iterator {
741741
self.push_back(elt);

trunk/src/libcollections/string.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,8 @@ impl FromIterator<char> for String {
683683
}
684684
}
685685

686-
#[experimental = "waiting on Extendable stabilization"]
687-
impl Extendable<char> for String {
686+
#[experimental = "waiting on Extend stabilization"]
687+
impl Extend<char> for String {
688688
fn extend<I:Iterator<char>>(&mut self, mut iterator: I) {
689689
for ch in iterator {
690690
self.push(ch)

trunk/src/libcollections/tree/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ impl<K: Ord, V> FromIterator<(K, V)> for TreeMap<K, V> {
12601260
}
12611261
}
12621262

1263-
impl<K: Ord, V> Extendable<(K, V)> for TreeMap<K, V> {
1263+
impl<K: Ord, V> Extend<(K, V)> for TreeMap<K, V> {
12641264
#[inline]
12651265
fn extend<T: Iterator<(K, V)>>(&mut self, mut iter: T) {
12661266
for (k, v) in iter {

trunk/src/libcollections/tree/set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ impl<T: Ord> FromIterator<T> for TreeSet<T> {
659659
}
660660
}
661661

662-
impl<T: Ord> Extendable<T> for TreeSet<T> {
662+
impl<T: Ord> Extend<T> for TreeSet<T> {
663663
#[inline]
664664
fn extend<Iter: Iterator<T>>(&mut self, mut iter: Iter) {
665665
for elem in iter {

trunk/src/libcollections/trie/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ impl<T> FromIterator<(uint, T)> for TrieMap<T> {
628628
}
629629
}
630630

631-
impl<T> Extendable<(uint, T)> for TrieMap<T> {
631+
impl<T> Extend<(uint, T)> for TrieMap<T> {
632632
fn extend<Iter: Iterator<(uint, T)>>(&mut self, mut iter: Iter) {
633633
for (k, v) in iter {
634634
self.insert(k, v);

trunk/src/libcollections/trie/set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ impl FromIterator<uint> for TrieSet {
355355
}
356356
}
357357

358-
impl Extendable<uint> for TrieSet {
358+
impl Extend<uint> for TrieSet {
359359
fn extend<Iter: Iterator<uint>>(&mut self, mut iter: Iter) {
360360
for elem in iter {
361361
self.insert(elem);

trunk/src/libcollections/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,8 @@ impl<T> FromIterator<T> for Vec<T> {
484484
}
485485
}
486486

487-
#[experimental = "waiting on Extendable stability"]
488-
impl<T> Extendable<T> for Vec<T> {
487+
#[experimental = "waiting on Extend stability"]
488+
impl<T> Extend<T> for Vec<T> {
489489
#[inline]
490490
fn extend<I: Iterator<T>>(&mut self, mut iterator: I) {
491491
let (lower, _) = iterator.size_hint();

trunk/src/libcollections/vec_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ impl<V> FromIterator<(uint, V)> for VecMap<V> {
499499
}
500500
}
501501

502-
impl<V> Extendable<(uint, V)> for VecMap<V> {
502+
impl<V> Extend<(uint, V)> for VecMap<V> {
503503
fn extend<Iter: Iterator<(uint, V)>>(&mut self, mut iter: Iter) {
504504
for (k, v) in iter {
505505
self.insert(k, v);

trunk/src/libcore/iter.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ use num::{Zero, One, CheckedAdd, CheckedSub, Saturating, ToPrimitive, Int};
6666
use ops::{Add, Mul, Sub};
6767
use option::{Option, Some, None};
6868
use uint;
69+
#[deprecated = "renamed to Extend"] pub use self::Extend as Extendable;
6970

7071
/// Conversion from an `Iterator`
7172
pub trait FromIterator<A> {
@@ -74,8 +75,8 @@ pub trait FromIterator<A> {
7475
}
7576

7677
/// A type growable from an `Iterator` implementation
77-
pub trait Extendable<A>: FromIterator<A> {
78-
/// Extend a container with the elements yielded by an iterator
78+
pub trait Extend<A> {
79+
/// Extend a container with the elements yielded by an arbitrary iterator
7980
fn extend<T: Iterator<A>>(&mut self, iterator: T);
8081
}
8182

trunk/src/libcore/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub use char::Char;
4848
pub use clone::Clone;
4949
pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
5050
pub use cmp::{Ordering, Less, Equal, Greater, Equiv};
51-
pub use iter::{FromIterator, Extendable};
51+
pub use iter::{FromIterator, Extend};
5252
pub use iter::{Iterator, DoubleEndedIterator, RandomAccessIterator, CloneableIterator};
5353
pub use iter::{OrdIterator, MutableDoubleEndedIterator, ExactSize};
5454
pub use num::{Num, NumCast, CheckedAdd, CheckedSub, CheckedMul};

trunk/src/libgreen/basic.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use alloc::arc::Arc;
1919
use std::sync::atomic;
2020
use std::mem;
21-
use std::rt::rtio::{EventLoop, IoFactory, RemoteCallback};
21+
use std::rt::rtio::{EventLoop, RemoteCallback};
2222
use std::rt::rtio::{PausableIdleCallback, Callback};
2323
use std::rt::exclusive::Exclusive;
2424

@@ -150,8 +150,6 @@ impl EventLoop for BasicLoop {
150150
Box<RemoteCallback + Send>
151151
}
152152

153-
fn io<'a>(&'a mut self) -> Option<&'a mut IoFactory> { None }
154-
155153
fn has_active_io(&self) -> bool { false }
156154
}
157155

trunk/src/libgreen/simple.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use std::mem;
1616
use std::rt::Runtime;
1717
use std::rt::local::Local;
1818
use std::rt::mutex::NativeMutex;
19-
use std::rt::rtio;
2019
use std::rt::task::{Task, BlockedTask, TaskOpts};
2120

2221
struct SimpleTask {
@@ -79,9 +78,10 @@ impl Runtime for SimpleTask {
7978
_f: proc():Send) {
8079
panic!()
8180
}
82-
fn local_io<'a>(&'a mut self) -> Option<rtio::LocalIo<'a>> { None }
81+
8382
fn stack_bounds(&self) -> (uint, uint) { panic!() }
8483
fn stack_guard(&self) -> Option<uint> { panic!() }
84+
8585
fn can_block(&self) -> bool { true }
8686
fn wrap(self: Box<SimpleTask>) -> Box<Any+'static> { panic!() }
8787
}

trunk/src/libgreen/task.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use std::raw;
2424
use std::rt::Runtime;
2525
use std::rt::local::Local;
2626
use std::rt::mutex::NativeMutex;
27-
use std::rt::rtio;
2827
use std::rt::stack;
2928
use std::rt::task::{Task, BlockedTask, TaskOpts};
3029
use std::rt;
@@ -468,14 +467,6 @@ impl Runtime for GreenTask {
468467
sched.run_task(me, sibling)
469468
}
470469

471-
// Local I/O is provided by the scheduler's event loop
472-
fn local_io<'a>(&'a mut self) -> Option<rtio::LocalIo<'a>> {
473-
match self.sched.as_mut().unwrap().event_loop.io() {
474-
Some(io) => Some(rtio::LocalIo::new(io)),
475-
None => None,
476-
}
477-
}
478-
479470
fn stack_bounds(&self) -> (uint, uint) {
480471
let c = self.coroutine.as_ref()
481472
.expect("GreenTask.stack_bounds called without a coroutine");

0 commit comments

Comments
 (0)