Skip to content

Commit 4d2e7d1

Browse files
committed
---
yaml --- r: 93047 b: refs/heads/auto c: cefb2c7 h: refs/heads/master i: 93045: b1626c1 93043: 1720826 93039: 6b3916e v: v3
1 parent c584b63 commit 4d2e7d1

File tree

293 files changed

+3710
-2740
lines changed

Some content is hidden

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

293 files changed

+3710
-2740
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: b432e82515f4cc145cf41bbcb92ff9b874b23afe
16+
refs/heads/auto: cefb2c7e45140e1492b3cb45601a538478f40577
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/doc/rust.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3605,8 +3605,10 @@ failed destructor. Nonetheless, the outermost unwinding activity will continue
36053605
until the stack is unwound and the task transitions to the *dead*
36063606
state. There is no way to "recover" from task failure. Once a task has
36073607
temporarily suspended its unwinding in the *failing* state, failure
3608-
occurring from within this destructor results in *hard* failure.
3609-
A hard failure currently results in the process aborting.
3608+
occurring from within this destructor results in *hard* failure. The
3609+
unwinding procedure of hard failure frees resources but does not execute
3610+
destructors. The original (soft) failure is still resumed at the point where
3611+
it was temporarily suspended.
36103612

36113613
A task in the *dead* state cannot transition to other states; it exists
36123614
only to have its termination status inspected by other tasks, and/or to await

branches/auto/doc/tutorial-conditions.md

Lines changed: 36 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,12 @@ $ ./example numbers.txt
4343

4444
An example program that does this task reads like this:
4545

46-
~~~~
46+
~~~~{.xfail-test}
4747
# #[allow(unused_imports)];
48-
# extern mod extra;
4948
use std::io::buffered::BufferedReader;
50-
use std::io::File;
49+
use std::io::fs::File;
5150
# mod BufferedReader {
52-
# use std::io::File;
51+
# use std::io::fs::File;
5352
# use std::io::mem::MemReader;
5453
# use std::io::buffered::BufferedReader;
5554
# static s : &'static [u8] = bytes!("1 2\n\
@@ -72,9 +71,10 @@ fn main() {
7271
fn read_int_pairs() -> ~[(int,int)] {
7372
let mut pairs = ~[];
7473
74+
let args = std::os::args();
75+
7576
// Path takes a generic by-value, rather than by reference
76-
# let _g = std::io::ignore_io_error();
77-
let path = Path::new(&"foo.txt");
77+
let path = Path::new(args.get_opt(1).expect("No input file parameter!").as_slice());
7878
let mut reader = BufferedReader::new(File::open(&path));
7979
8080
// 1. Iterate over the lines of our file.
@@ -242,14 +242,13 @@ If the example is rewritten to use failure, these error cases can be trapped.
242242
In this rewriting, failures are trapped by placing the I/O logic in a sub-task,
243243
and trapping its exit status using `task::try`:
244244

245-
~~~~
245+
~~~~{.xfail-test}
246246
# #[allow(unused_imports)];
247-
# extern mod extra;
248247
use std::io::buffered::BufferedReader;
249-
use std::io::File;
248+
use std::io::fs::File;
250249
use std::task;
251250
# mod BufferedReader {
252-
# use std::io::File;
251+
# use std::io::fs::File;
253252
# use std::io::mem::MemReader;
254253
# use std::io::buffered::BufferedReader;
255254
# static s : &'static [u8] = bytes!("1 2\n\
@@ -281,8 +280,8 @@ fn main() {
281280
282281
fn read_int_pairs() -> ~[(int,int)] {
283282
let mut pairs = ~[];
284-
# let _g = std::io::ignore_io_error();
285-
let path = Path::new(&"foo.txt");
283+
let args = std::os::args();
284+
let path = Path::new(args.get_opt(1).expect("No input file parameter!").as_slice());
286285
287286
let mut reader = BufferedReader::new(File::open(&path));
288287
for line in reader.lines() {
@@ -347,13 +346,12 @@ If no handler is found, `Condition::raise` will fail the task with an appropriat
347346
Rewriting the example to use a condition in place of ignoring malformed lines makes it slightly longer,
348347
but similarly clear as the version that used `fail!` in the logic where the error occurs:
349348

350-
~~~~
349+
~~~~{.xfail-test}
351350
# #[allow(unused_imports)];
352-
# extern mod extra;
353351
use std::io::buffered::BufferedReader;
354-
use std::io::File;
352+
use std::io::fs::File;
355353
# mod BufferedReader {
356-
# use std::io::File;
354+
# use std::io::fs::File;
357355
# use std::io::mem::MemReader;
358356
# use std::io::buffered::BufferedReader;
359357
# static s : &'static [u8] = bytes!("1 2\n\
@@ -380,8 +378,8 @@ fn main() {
380378
381379
fn read_int_pairs() -> ~[(int,int)] {
382380
let mut pairs = ~[];
383-
# let _g = std::io::ignore_io_error();
384-
let path = Path::new(&"foo.txt");
381+
let args = std::os::args();
382+
let path = Path::new(args.get_opt(1).expect("No input file parameter!").as_slice());
385383
386384
let mut reader = BufferedReader::new(File::open(&path));
387385
for line in reader.lines() {
@@ -417,13 +415,12 @@ To trap a condition, use `Condition::trap` in some caller of the site that calls
417415
For example, this version of the program traps the `malformed_line` condition
418416
and replaces bad input lines with the pair `(-1,-1)`:
419417

420-
~~~~
418+
~~~~{.xfail-test}
421419
# #[allow(unused_imports)];
422-
# extern mod extra;
423420
use std::io::buffered::BufferedReader;
424-
use std::io::File;
421+
use std::io::fs::File;
425422
# mod BufferedReader {
426-
# use std::io::File;
423+
# use std::io::fs::File;
427424
# use std::io::mem::MemReader;
428425
# use std::io::buffered::BufferedReader;
429426
# static s : &'static [u8] = bytes!("1 2\n\
@@ -455,8 +452,8 @@ fn main() {
455452
456453
fn read_int_pairs() -> ~[(int,int)] {
457454
let mut pairs = ~[];
458-
# let _g = std::io::ignore_io_error();
459-
let path = Path::new(&"foo.txt");
455+
let args = std::os::args();
456+
let path = Path::new(args.get_opt(1).expect("No input file parameter!").as_slice());
460457
461458
let mut reader = BufferedReader::new(File::open(&path));
462459
for line in reader.lines() {
@@ -493,13 +490,12 @@ In the example program, the first form of the `malformed_line` API implicitly as
493490
This assumption may not be correct; some callers may wish to skip malformed lines, for example.
494491
Changing the condition's return type from `(int,int)` to `Option<(int,int)>` will suffice to support this type of recovery:
495492

496-
~~~~
493+
~~~~{.xfail-test}
497494
# #[allow(unused_imports)];
498-
# extern mod extra;
499495
use std::io::buffered::BufferedReader;
500-
use std::io::File;
496+
use std::io::fs::File;
501497
# mod BufferedReader {
502-
# use std::io::File;
498+
# use std::io::fs::File;
503499
# use std::io::mem::MemReader;
504500
# use std::io::buffered::BufferedReader;
505501
# static s : &'static [u8] = bytes!("1 2\n\
@@ -532,8 +528,8 @@ fn main() {
532528
533529
fn read_int_pairs() -> ~[(int,int)] {
534530
let mut pairs = ~[];
535-
# let _g = std::io::ignore_io_error();
536-
let path = Path::new(&"foo.txt");
531+
let args = std::os::args();
532+
let path = Path::new(args.get_opt(1).expect("No input file parameter!").as_slice());
537533
538534
let mut reader = BufferedReader::new(File::open(&path));
539535
for line in reader.lines() {
@@ -579,13 +575,12 @@ until all relevant combinations encountered in practice are encoded.
579575
In the example, suppose a third possible recovery form arose: reusing the previous value read.
580576
This can be encoded in the handler API by introducing a helper type: `enum MalformedLineFix`.
581577

582-
~~~~
578+
~~~~{.xfail-test}
583579
# #[allow(unused_imports)];
584-
# extern mod extra;
585580
use std::io::buffered::BufferedReader;
586-
use std::io::File;
581+
use std::io::fs::File;
587582
# mod BufferedReader {
588-
# use std::io::File;
583+
# use std::io::fs::File;
589584
# use std::io::mem::MemReader;
590585
# use std::io::buffered::BufferedReader;
591586
# static s : &'static [u8] = bytes!("1 2\n\
@@ -627,8 +622,8 @@ fn main() {
627622
628623
fn read_int_pairs() -> ~[(int,int)] {
629624
let mut pairs = ~[];
630-
# let _g = std::io::ignore_io_error();
631-
let path = Path::new(&"foo.txt");
625+
let args = std::os::args();
626+
let path = Path::new(args.get_opt(1).expect("No input file parameter!").as_slice());
632627
633628
let mut reader = BufferedReader::new(File::open(&path));
634629
for line in reader.lines() {
@@ -704,13 +699,12 @@ task <unnamed> failed at 'called `Option::unwrap()` on a `None` value', .../libs
704699
To make the program robust &mdash; or at least flexible &mdash; in the face of this potential failure,
705700
a second condition and a helper function will suffice:
706701

707-
~~~~
702+
~~~~{.xfail-test}
708703
# #[allow(unused_imports)];
709-
# extern mod extra;
710704
use std::io::buffered::BufferedReader;
711-
use std::io::File;
705+
use std::io::fs::File;
712706
# mod BufferedReader {
713-
# use std::io::File;
707+
# use std::io::fs::File;
714708
# use std::io::mem::MemReader;
715709
# use std::io::buffered::BufferedReader;
716710
# static s : &'static [u8] = bytes!("1 2\n\
@@ -766,8 +760,8 @@ fn parse_int(x: &str) -> int {
766760
767761
fn read_int_pairs() -> ~[(int,int)] {
768762
let mut pairs = ~[];
769-
# let _g = std::io::ignore_io_error();
770-
let path = Path::new(&"foo.txt");
763+
let args = std::os::args();
764+
let path = Path::new(args.get_opt(1).expect("No input file parameter!").as_slice());
771765
772766
let mut reader = BufferedReader::new(File::open(&path));
773767
for line in reader.lines() {

branches/auto/doc/tutorial.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,8 +1431,8 @@ For a more in-depth explanation of borrowed pointers, read the
14311431
## Freezing
14321432
14331433
Lending an immutable pointer to an object freezes it and prevents mutation.
1434-
`Freeze` objects have freezing enforced statically at compile-time. An example
1435-
of a non-`Freeze` type is [`RefCell<T>`][refcell].
1434+
`Freeze` objects have freezing enforced statically at compile-time. Examples
1435+
of non-`Freeze` types are `@mut` and [`RefCell<T>`][refcell].
14361436
14371437
~~~~
14381438
let mut x = 5;
@@ -1443,6 +1443,20 @@ let mut x = 5;
14431443
# x = 3;
14441444
~~~~
14451445
1446+
Mutable managed boxes handle freezing dynamically when any of their contents
1447+
are borrowed, and the task will fail if an attempt to modify them is made while
1448+
they are frozen:
1449+
1450+
~~~~
1451+
let x = @mut 5;
1452+
let y = x;
1453+
{
1454+
let z = &*y; // the managed box is now frozen
1455+
// modifying it through x or y will cause a task failure
1456+
}
1457+
// the box is now unfrozen again
1458+
~~~~
1459+
14461460
[refcell]: http://static.rust-lang.org/doc/master/std/cell/struct.RefCell.html
14471461
14481462
# Dereferencing pointers
@@ -1463,12 +1477,13 @@ assignments. Such an assignment modifies the value that the pointer
14631477
points to.
14641478
14651479
~~~
1466-
let managed = @10;
1480+
let managed = @mut 10;
14671481
let mut owned = ~20;
14681482

14691483
let mut value = 30;
14701484
let borrowed = &mut value;
14711485

1486+
*managed = *owned + 10;
14721487
*owned = *borrowed + 100;
14731488
*borrowed = *managed + 1000;
14741489
~~~
@@ -2098,7 +2113,8 @@ unless they contain managed boxes, managed closures, or borrowed pointers.
20982113
20992114
* `Freeze` - Constant (immutable) types.
21002115
These are types that do not contain anything intrinsically mutable.
2101-
Intrinsically mutable values include `Cell` in the standard library.
2116+
Intrinsically mutable values include `@mut`
2117+
and `Cell` in the standard library.
21022118
21032119
* `'static` - Non-borrowed types.
21042120
These are types that do not contain any data whose lifetime is bound to

branches/auto/mk/llvm.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ endef
4747
$(foreach host,$(CFG_HOST), \
4848
$(eval LLVM_CONFIGS := $(LLVM_CONFIGS) $(LLVM_CONFIG_$(host))))
4949

50-
$(foreach host,$(CFG_HOST), \
51-
$(eval $(call DEF_LLVM_RULES,$(host))))
52-
5350
$(S)src/librustc/lib/llvmdeps.rs: \
5451
$(LLVM_CONFIGS) \
5552
$(S)src/etc/mklldeps.py
5653
$(Q)$(CFG_PYTHON) $(S)src/etc/mklldeps.py \
5754
"$@" "$(LLVM_COMPONENTS)" $(LLVM_CONFIGS)
55+
56+
$(foreach host,$(CFG_HOST), \
57+
$(eval $(call DEF_LLVM_RULES,$(host))))

0 commit comments

Comments
 (0)