Skip to content

Commit 6e72df8

Browse files
committed
---
yaml --- r: 158966 b: refs/heads/master c: a30b72b h: refs/heads/master v: v3
1 parent d7e02f4 commit 6e72df8

File tree

126 files changed

+4893
-4482
lines changed

Some content is hidden

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

126 files changed

+4893
-4482
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: c0a7d557dbea830ae581ecb3f77f08b7e4daad4a
2+
refs/heads/master: a30b72bb1420620d5b36dbd221a81374d3668271
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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ syn keyword rustConditional match if else
1717
syn keyword rustOperator as
1818

1919
syn match rustAssert "\<assert\(\w\)*!" contained
20-
syn match rustFail "\<fail\(\w\)*!" contained
20+
syn match rustPanic "\<panic\(\w\)*!" contained
2121
syn keyword rustKeyword break
2222
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
2323
syn keyword rustKeyword continue
2424
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
2525
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
26-
syn keyword rustKeyword for in if impl let
26+
syn keyword rustKeyword for in if impl let move
2727
syn keyword rustKeyword loop once proc pub
2828
syn keyword rustKeyword return super
2929
syn keyword rustKeyword unsafe virtual where while
@@ -151,8 +151,8 @@ syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1
151151
" Last, because the & in && isn't a sigil
152152
syn match rustOperator display "&&\|||"
153153

154-
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustFail
155-
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail
154+
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic
155+
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic
156156

157157
syn match rustEscapeError display contained /\\./
158158
syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/
@@ -263,7 +263,7 @@ hi def link rustCommentLineDoc SpecialComment
263263
hi def link rustCommentBlock rustCommentLine
264264
hi def link rustCommentBlockDoc rustCommentLineDoc
265265
hi def link rustAssert PreCondit
266-
hi def link rustFail PreCondit
266+
hi def link rustPanic PreCondit
267267
hi def link rustMacro Macro
268268
hi def link rustType Type
269269
hi def link rustTodo Todo
@@ -282,7 +282,7 @@ hi def link rustBoxPlacementExpr rustKeyword
282282
" hi rustAttribute ctermfg=cyan
283283
" hi rustDeriving ctermfg=cyan
284284
" hi rustAssert ctermfg=yellow
285-
" hi rustFail ctermfg=red
285+
" hi rustPanic ctermfg=red
286286
" hi rustMacro ctermfg=magenta
287287

288288
syn sync minlines=200

trunk/src/libcollections/enum_set.rs

Lines changed: 26 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,
@@ -433,9 +438,29 @@ mod test {
433438
let elems = e_intersection.iter().collect();
434439
assert_eq!(vec![C], elems)
435440

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+
436446
let e_subtract = e1 - e2;
437447
let elems = e_subtract.iter().collect();
438448
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)
439464
}
440465

441466
#[test]

trunk/src/libcore/num/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use {int, i8, i16, i32, i64};
1919
use {uint, u8, u16, u32, u64};
2020
use {f32, f64};
2121
use clone::Clone;
22-
use cmp::{PartialEq, PartialOrd};
22+
use cmp::{Ord, PartialEq, PartialOrd};
2323
use kinds::Copy;
2424
use mem::size_of;
2525
use ops::{Add, Sub, Mul, Div, Rem, Neg};
@@ -386,6 +386,7 @@ trait_impl!(Primitive for uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64)
386386
/// A primitive signed or unsigned integer equipped with various bitwise
387387
/// operators, bit counting methods, and endian conversion functions.
388388
pub trait Int: Primitive
389+
+ Ord
389390
+ CheckedAdd
390391
+ CheckedSub
391392
+ 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)