Skip to content

Commit 9ef3a4f

Browse files
committed
---
yaml --- r: 60619 b: refs/heads/auto c: ee1b419 h: refs/heads/master i: 60617: 61e7289 60615: 1845a4e v: v3
1 parent 227ca91 commit 9ef3a4f

File tree

892 files changed

+20001
-14584
lines changed

Some content is hidden

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

892 files changed

+20001
-14584
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: b17b3f95762e7ca368dfce6d2bb00e820e503296
17+
refs/heads/auto: ee1b41981873805c69a122c0e6ed25d39e55b535
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/doc/rust.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,6 @@ names are effectively reserved. Some significant attributes include:
14261426
by the compiler can be found via `rustc -W help`.
14271427
* The `deriving` attribute, for automatically generating
14281428
implementations of certain traits.
1429-
* The `static_assert` attribute, for asserting that a static bool is true at compiletime
14301429

14311430
Other attributes may be added or removed during development of the language.
14321431

@@ -2251,14 +2250,6 @@ do_expr : "do" expr [ '|' ident_list '|' ] ? '{' block '}' ;
22512250
A _do expression_ provides a more-familiar block-syntax for a [lambda expression](#lambda-expressions),
22522251
including a special translation of [return expressions](#return-expressions) inside the supplied block.
22532252

2254-
Any occurrence of a [return expression](#return-expressions)
2255-
inside this `block` expression is rewritten
2256-
as a reference to an (anonymous) flag set in the caller's environment,
2257-
which is checked on return from the `expr` and, if set,
2258-
causes a corresponding return from the caller.
2259-
In this way, the meaning of `return` statements in language built-in control blocks is preserved,
2260-
if they are rewritten using lambda functions and `do` expressions as abstractions.
2261-
22622253
The optional `ident_list` and `block` provided in a `do` expression are parsed as though they constitute a lambda expression;
22632254
if the `ident_list` is missing, an empty `ident_list` is implied.
22642255

@@ -2305,15 +2296,19 @@ A _for expression_ is similar to a [`do` expression](#do-expressions),
23052296
in that it provides a special block-form of lambda expression,
23062297
suited to passing the `block` function to a higher-order function implementing a loop.
23072298

2308-
In contrast to a `do` expression, a `for` expression is designed to work
2309-
with methods such as `each` and `times`, that require the body block to
2310-
return a boolean. The `for` expression accommodates this by implicitly
2311-
returning `true` at the end of each block, unless a `break` expression
2312-
is evaluated.
2299+
Like a `do` expression, a `return` expression inside a `for` expresison is rewritten,
2300+
to access a local flag that causes an early return in the caller.
2301+
2302+
Additionally, any occurrence of a [return expression](#return-expressions)
2303+
inside the `block` of a `for` expression is rewritten
2304+
as a reference to an (anonymous) flag set in the caller's environment,
2305+
which is checked on return from the `expr` and, if set,
2306+
causes a corresponding return from the caller.
2307+
In this way, the meaning of `return` statements in language built-in control blocks is preserved,
2308+
if they are rewritten using lambda functions and `do` expressions as abstractions.
23132309

2314-
In addition, [`break`](#break-expressions) and [`loop`](#loop-expressions) expressions
2315-
are rewritten inside `for` expressions in the same way that `return` expressions are,
2316-
with a combination of local flag variables,
2310+
Like `return` expressions, any [`break`](#break-expressions) and [`loop`](#loop-expressions) expressions
2311+
are rewritten inside `for` expressions, with a combination of local flag variables,
23172312
and early boolean-valued returns from the `block` function,
23182313
such that the meaning of `break` and `loop` is preserved in a primitive loop
23192314
when rewritten as a `for` loop controlled by a higher order function.

branches/auto/doc/tutorial-tasks.md

Lines changed: 13 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,22 @@ in the core and standard libraries, which are still under development
4343
and do not always present a consistent or complete interface.
4444

4545
For your reference, these are the standard modules involved in Rust
46-
concurrency at this writing:
46+
concurrency at this writing.
4747

48-
* [`core::task`] - All code relating to tasks and task scheduling,
49-
* [`core::comm`] - The message passing interface,
50-
* [`core::pipes`] - The underlying messaging infrastructure,
51-
* [`std::comm`] - Additional messaging types based on `core::pipes`,
52-
* [`std::sync`] - More exotic synchronization tools, including locks,
48+
* [`core::task`] - All code relating to tasks and task scheduling
49+
* [`core::comm`] - The message passing interface
50+
* [`core::pipes`] - The underlying messaging infrastructure
51+
* [`std::comm`] - Additional messaging types based on `core::pipes`
52+
* [`std::sync`] - More exotic synchronization tools, including locks
5353
* [`std::arc`] - The ARC (atomically reference counted) type,
54-
for safely sharing immutable data,
55-
* [`std::future`] - A type representing values that may be computed concurrently and retrieved at a later time.
54+
for safely sharing immutable data
5655

5756
[`core::task`]: core/task.html
5857
[`core::comm`]: core/comm.html
5958
[`core::pipes`]: core/pipes.html
6059
[`std::comm`]: std/comm.html
6160
[`std::sync`]: std/sync.html
6261
[`std::arc`]: std/arc.html
63-
[`std::future`]: std/future.html
6462

6563
# Basics
6664

@@ -72,7 +70,7 @@ closure in the new task.
7270

7371
~~~~
7472
# use core::io::println;
75-
# use core::task::spawn;
73+
use core::task::spawn;
7674
7775
// Print something profound in a different task using a named function
7876
fn print_message() { println("I am running in a different task!"); }
@@ -147,8 +145,8 @@ endpoint. Consider the following example of calculating two results
147145
concurrently:
148146

149147
~~~~
150-
# use core::task::spawn;
151-
# use core::comm::{stream, Port, Chan};
148+
use core::task::spawn;
149+
use core::comm::{stream, Port, Chan};
152150
153151
let (port, chan): (Port<int>, Chan<int>) = stream();
154152
@@ -235,7 +233,7 @@ Instead we can use a `SharedChan`, a type that allows a single
235233

236234
~~~
237235
# use core::task::spawn;
238-
# use core::comm::{stream, SharedChan};
236+
use core::comm::{stream, SharedChan};
239237
240238
let (port, chan) = stream();
241239
let chan = SharedChan::new(chan);
@@ -284,51 +282,6 @@ let result = ports.foldl(0, |accum, port| *accum + port.recv() );
284282
# fn some_expensive_computation(_i: uint) -> int { 42 }
285283
~~~
286284

287-
## Futures
288-
With `std::future`, rust has a mechanism for requesting a computation and getting the result
289-
later.
290-
291-
The basic example below illustrates this.
292-
~~~
293-
# fn make_a_sandwich() {};
294-
fn fib(n: uint) -> uint {
295-
// lengthy computation returning an uint
296-
12586269025
297-
}
298-
299-
let mut delayed_fib = std::future::spawn (|| fib(50) );
300-
make_a_sandwich();
301-
println(fmt!("fib(50) = %?", delayed_fib.get()))
302-
~~~
303-
304-
The call to `future::spawn` returns immediately a `future` object regardless of how long it
305-
takes to run `fib(50)`. You can then make yourself a sandwich while the computation of `fib` is
306-
running. The result of the execution of the method is obtained by calling `get` on the future.
307-
This call will block until the value is available (*i.e.* the computation is complete). Note that
308-
the future needs to be mutable so that it can save the result for next time `get` is called.
309-
310-
Here is another example showing how futures allow you to background computations. The workload will
311-
be distributed on the available cores.
312-
~~~
313-
fn partial_sum(start: uint) -> f64 {
314-
let mut local_sum = 0f64;
315-
for uint::range(start*100000, (start+1)*100000) |num| {
316-
local_sum += (num as f64 + 1.0).pow(-2.0);
317-
}
318-
local_sum
319-
}
320-
321-
fn main() {
322-
let mut futures = vec::from_fn(1000, |ind| do std::future::spawn { partial_sum(ind) });
323-
324-
let mut final_res = 0f64;
325-
for futures.each_mut |ft| {
326-
final_res += ft.get();
327-
}
328-
println(fmt!("π^2/6 is not far from : %?", final_res));
329-
}
330-
~~~
331-
332285
# Handling task failure
333286

334287
Rust has a built-in mechanism for raising exceptions. The `fail!()` macro
@@ -410,8 +363,8 @@ either task fails, it kills the other one.
410363
~~~
411364
# fn sleep_forever() { loop { task::yield() } }
412365
# do task::try {
413-
do spawn {
414-
do spawn {
366+
do task::spawn {
367+
do task::spawn {
415368
fail!(); // All three tasks will fail.
416369
}
417370
sleep_forever(); // Will get woken up by force, then fail

branches/auto/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,7 @@ struct TimeBomb {
19771977
19781978
impl Drop for TimeBomb {
19791979
fn finalize(&self) {
1980-
for self.explosivity.times {
1980+
for old_iter::repeat(self.explosivity) {
19811981
println("blam!");
19821982
}
19831983
}

branches/auto/mk/platform.mk

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -239,32 +239,6 @@ CFG_RUN_arm-linux-androideabi=
239239
CFG_RUN_TARG_arm-linux-androideabi=
240240
RUSTC_FLAGS_arm-linux-androideabi :=--android-cross-path=$(CFG_ANDROID_CROSS_PATH)
241241

242-
# arm-unknown-linux-gnueabihf configuration
243-
CC_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-gcc
244-
CXX_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-g++
245-
CPP_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-gcc -E
246-
AR_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-ar
247-
CFG_LIB_NAME_arm-unknown-linux-gnueabihf=lib$(1).so
248-
CFG_LIB_GLOB_arm-unknown-linux-gnueabihf=lib$(1)-*.so
249-
CFG_LIB_DSYM_GLOB_arm-unknown-linux-gnueabihf=lib$(1)-*.dylib.dSYM
250-
CFG_GCCISH_CFLAGS_arm-unknown-linux-gnueabihf := -Wall -g -fPIC
251-
CFG_GCCISH_CXXFLAGS_arm-unknown-linux-gnueabihf := -fno-rtti
252-
CFG_GCCISH_LINK_FLAGS_arm-unknown-linux-gnueabihf := -shared -fPIC -g
253-
CFG_GCCISH_DEF_FLAG_arm-unknown-linux-gnueabihf := -Wl,--export-dynamic,--dynamic-list=
254-
CFG_GCCISH_PRE_LIB_FLAGS_arm-unknown-linux-gnueabihf := -Wl,-whole-archive
255-
CFG_GCCISH_POST_LIB_FLAGS_arm-unknown-linux-gnueabihf := -Wl,-no-whole-archive
256-
CFG_DEF_SUFFIX_arm-unknown-linux-gnueabihf := .linux.def
257-
CFG_INSTALL_NAME_ar,-unknown-linux-gnueabihf =
258-
CFG_LIBUV_LINK_FLAGS_arm-unknown-linux-gnueabihf =
259-
CFG_EXE_SUFFIX_arm-unknown-linux-gnueabihf :=
260-
CFG_WINDOWSY_arm-unknown-linux-gnueabihf :=
261-
CFG_UNIXY_arm-unknown-linux-gnueabihf := 1
262-
CFG_PATH_MUNGE_arm-unknown-linux-gnueabihf := true
263-
CFG_LDPATH_arm-unknown-linux-gnueabihf :=
264-
CFG_RUN_arm-unknown-linux-gnueabihf=
265-
CFG_RUN_TARG_arm-unknown-linux-gnueabihf=
266-
RUSTC_FLAGS_arm-unknown-linux-gnueabihf := --linker=$(CC_arm-unknown-linux-gnueabihf)
267-
268242
# mips-unknown-linux-gnu configuration
269243
CC_mips-unknown-linux-gnu=mips-linux-gnu-gcc
270244
CXX_mips-unknown-linux-gnu=mips-linux-gnu-g++

branches/auto/mk/rt.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@
2626
# Hack for passing flags into LIBUV, see below.
2727
LIBUV_FLAGS_i386 = -m32 -fPIC
2828
LIBUV_FLAGS_x86_64 = -m64 -fPIC
29-
ifeq ($(OSTYPE_$(1)), linux-androideabi)
3029
LIBUV_FLAGS_arm = -fPIC -DANDROID -std=gnu99
31-
else
32-
LIBUV_FLAGS_arm = -fPIC -std=gnu99
33-
endif
3430
LIBUV_FLAGS_mips = -fPIC -mips32r2 -msoft-float -mabi=32
3531

3632
# when we're doing a snapshot build, we intentionally degrade as many

branches/auto/src/compiletest/compiletest.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#[allow(non_camel_case_types)];
1414

15-
extern mod std;
15+
extern mod std(vers = "0.7-pre");
1616

1717
use core::*;
1818

branches/auto/src/driver/driver.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
// except according to those terms.
1010

1111
#[cfg(rustpkg)]
12-
extern mod this(name = "rustpkg");
12+
extern mod this(name = "rustpkg", vers = "0.7-pre");
1313

1414
#[cfg(fuzzer)]
15-
extern mod this(name = "fuzzer");
15+
extern mod this(name = "fuzzer", vers = "0.7-pre");
1616

1717
#[cfg(rustdoc)]
18-
extern mod this(name = "rustdoc");
18+
extern mod this(name = "rustdoc", vers = "0.7-pre");
1919

2020
#[cfg(rusti)]
21-
extern mod this(name = "rusti");
21+
extern mod this(name = "rusti", vers = "0.7-pre");
2222

2323
#[cfg(rust)]
24-
extern mod this(name = "rust");
24+
extern mod this(name = "rust", vers = "0.7-pre");
2525

2626
#[cfg(rustc)]
27-
extern mod this(name = "rustc");
27+
extern mod this(name = "rustc", vers = "0.7-pre");
2828

2929
fn main() { this::main() }

branches/auto/src/libcore/at_vec.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -294,30 +294,30 @@ mod test {
294294
}
295295

296296
assert_eq!(seq_range(10, 15), @[10, 11, 12, 13, 14]);
297-
assert_eq!(from_fn(5, |x| x+1), @[1, 2, 3, 4, 5]);
298-
assert_eq!(from_elem(5, 3.14), @[3.14, 3.14, 3.14, 3.14, 3.14]);
297+
assert!(from_fn(5, |x| x+1) == @[1, 2, 3, 4, 5]);
298+
assert!(from_elem(5, 3.14) == @[3.14, 3.14, 3.14, 3.14, 3.14]);
299299
}
300300

301301
#[test]
302302
fn append_test() {
303-
assert_eq!(@[1,2,3] + @[4,5,6], @[1,2,3,4,5,6]);
303+
assert!(@[1,2,3] + @[4,5,6] == @[1,2,3,4,5,6]);
304304
}
305305

306306
#[test]
307307
fn test_to_managed_consume() {
308-
assert_eq!(to_managed_consume::<int>(~[]), @[]);
309-
assert_eq!(to_managed_consume(~[true]), @[true]);
310-
assert_eq!(to_managed_consume(~[1, 2, 3, 4, 5]), @[1, 2, 3, 4, 5]);
311-
assert_eq!(to_managed_consume(~[~"abc", ~"123"]), @[~"abc", ~"123"]);
312-
assert_eq!(to_managed_consume(~[~[42]]), @[~[42]]);
308+
assert!(to_managed_consume::<int>(~[]) == @[]);
309+
assert!(to_managed_consume(~[true]) == @[true]);
310+
assert!(to_managed_consume(~[1, 2, 3, 4, 5]) == @[1, 2, 3, 4, 5]);
311+
assert!(to_managed_consume(~[~"abc", ~"123"]) == @[~"abc", ~"123"]);
312+
assert!(to_managed_consume(~[~[42]]) == @[~[42]]);
313313
}
314314
315315
#[test]
316316
fn test_to_managed() {
317-
assert_eq!(to_managed::<int>([]), @[]);
318-
assert_eq!(to_managed([true]), @[true]);
319-
assert_eq!(to_managed([1, 2, 3, 4, 5]), @[1, 2, 3, 4, 5]);
320-
assert_eq!(to_managed([@"abc", @"123"]), @[@"abc", @"123"]);
321-
assert_eq!(to_managed([@[42]]), @[@[42]]);
317+
assert!(to_managed::<int>([]) == @[]);
318+
assert!(to_managed([true]) == @[true]);
319+
assert!(to_managed([1, 2, 3, 4, 5]) == @[1, 2, 3, 4, 5]);
320+
assert!(to_managed([@"abc", @"123"]) == @[@"abc", @"123"]);
321+
assert!(to_managed([@[42]]) == @[@[42]]);
322322
}
323323
}

branches/auto/src/libcore/bool.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ pub fn is_false(v: bool) -> bool { !v }
4949
/// Parse logic value from `s`
5050
impl FromStr for bool {
5151
fn from_str(s: &str) -> Option<bool> {
52-
match s {
53-
"true" => Some(true),
54-
"false" => Some(false),
55-
_ => None,
52+
if s == "true" {
53+
Some(true)
54+
} else if s == "false" {
55+
Some(false)
56+
} else {
57+
None
5658
}
5759
}
5860
}
@@ -113,14 +115,14 @@ mod tests {
113115

114116
#[test]
115117
fn test_bool_to_str() {
116-
assert_eq!(to_str(false), ~"false");
117-
assert_eq!(to_str(true), ~"true");
118+
assert!(to_str(false) == ~"false");
119+
assert!(to_str(true) == ~"true");
118120
}
119121

120122
#[test]
121123
fn test_bool_to_bit() {
122124
do all_values |v| {
123-
assert_eq!(to_bit(v), if is_true(v) { 1u8 } else { 0u8 });
125+
assert!(to_bit(v) == if is_true(v) { 1u8 } else { 0u8 });
124126
}
125127
}
126128

0 commit comments

Comments
 (0)