Skip to content

Commit e9da950

Browse files
committed
---
yaml --- r: 157675 b: refs/heads/snap-stage3 c: e0ad0fc h: refs/heads/master i: 157673: e60bbe4 157671: 7ff644f v: v3
1 parent 0b12c35 commit e9da950

File tree

732 files changed

+5440
-5962
lines changed

Some content is hidden

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

732 files changed

+5440
-5962
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: 065caf34f5ff29e04605f95d9c5d511af219439a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: f68dafa5059b84b6102dfd7b1e1cee9aae86b220
4+
refs/heads/snap-stage3: e0ad0fcb95f0bd6e69e9032c23b66515a590dfe5
55
refs/heads/try: 0ee4d8b0b112c608646fa75463ab4dc59132efd9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/mk/llvm.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ endif
3838
# the stamp in the source dir.
3939
$$(LLVM_STAMP_$(1)): $(S)src/rustllvm/llvm-auto-clean-trigger
4040
@$$(call E, make: cleaning llvm)
41-
$(Q)$(MAKE) clean-llvm$(1)
41+
$(Q)$(MAKE) clean-llvm
4242
@$$(call E, make: done cleaning llvm)
4343
touch $$@
4444

branches/snap-stage3/mk/main.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ RUSTFLAGS_STAGE1 += -C prefer-dynamic
157157
# by not emitting them.
158158
RUSTFLAGS_STAGE0 += -Z no-landing-pads
159159

160+
# Go fast for stage0, and also for stage1/stage2 if optimization is off.
161+
RUSTFLAGS_STAGE0 += -C codegen-units=4
162+
ifdef CFG_DISABLE_OPTIMIZE
163+
RUSTFLAGS_STAGE1 += -C codegen-units=4
164+
RUSTFLAGS_STAGE2 += -C codegen-units=4
165+
endif
166+
160167
# platform-specific auto-configuration
161168
include $(CFG_SRC_DIR)mk/platform.mk
162169

branches/snap-stage3/mk/tests.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,10 @@ CTEST_RUSTC_FLAGS := $$(subst -O,,$$(CTEST_RUSTC_FLAGS))
633633
ifndef CFG_DISABLE_OPTIMIZE_TESTS
634634
CTEST_RUSTC_FLAGS += -O
635635
endif
636+
# Force codegen-units=1 for compiletest tests. compiletest does its own
637+
# parallelization internally, so rustc's default codegen-units=2 will actually
638+
# slow things down.
639+
CTEST_RUSTC_FLAGS += -C codegen-units=1
636640

637641

638642
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn main() {
4141
let config = parse_config(args);
4242

4343
if config.valgrind_path.is_none() && config.force_valgrind {
44-
panic!("Can't find Valgrind to run Valgrind tests");
44+
fail!("Can't find Valgrind to run Valgrind tests");
4545
}
4646

4747
log_config(&config);
@@ -94,20 +94,20 @@ pub fn parse_config(args: Vec<String> ) -> Config {
9494
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
9595
println!("{}", getopts::usage(message.as_slice(), groups.as_slice()));
9696
println!("");
97-
panic!()
97+
fail!()
9898
}
9999

100100
let matches =
101101
&match getopts::getopts(args_.as_slice(), groups.as_slice()) {
102102
Ok(m) => m,
103-
Err(f) => panic!("{}", f)
103+
Err(f) => fail!("{}", f)
104104
};
105105

106106
if matches.opt_present("h") || matches.opt_present("help") {
107107
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
108108
println!("{}", getopts::usage(message.as_slice(), groups.as_slice()));
109109
println!("");
110-
panic!()
110+
fail!()
111111
}
112112

113113
fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
@@ -120,7 +120,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
120120
Ok(re) => Some(re),
121121
Err(e) => {
122122
println!("failed to parse filter /{}/: {}", s, e);
123-
panic!()
123+
fail!()
124124
}
125125
}
126126
} else {
@@ -263,7 +263,7 @@ pub fn run_tests(config: &Config) {
263263
let res = test::run_tests_console(&opts, tests.into_iter().collect());
264264
match res {
265265
Ok(true) => {}
266-
Ok(false) => panic!("Some tests failed"),
266+
Ok(false) => fail!("Some tests failed"),
267267
Err(e) => {
268268
println!("I/O failure during tests: {}", e);
269269
}

branches/snap-stage3/src/compiletest/header.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ fn parse_exec_env(line: &str) -> Option<(String, String)> {
305305
let end = strs.pop().unwrap();
306306
(strs.pop().unwrap(), end)
307307
}
308-
n => panic!("Expected 1 or 2 strings, not {}", n)
308+
n => fail!("Expected 1 or 2 strings, not {}", n)
309309
}
310310
})
311311
}
@@ -350,7 +350,7 @@ pub fn gdb_version_to_int(version_string: &str) -> int {
350350
let components: Vec<&str> = version_string.trim().split('.').collect();
351351

352352
if components.len() != 2 {
353-
panic!("{}", error_string);
353+
fail!("{}", error_string);
354354
}
355355

356356
let major: int = FromStr::from_str(components[0]).expect(error_string);

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub fn run(config: Config, testfile: String) {
3939

4040
"arm-linux-androideabi" => {
4141
if !config.adb_device_status {
42-
panic!("android device not available");
42+
fail!("android device not available");
4343
}
4444
}
4545

@@ -316,7 +316,7 @@ actual:\n\
316316
------------------------------------------\n\
317317
\n",
318318
expected, actual);
319-
panic!();
319+
fail!();
320320
}
321321
}
322322

@@ -1453,7 +1453,7 @@ fn maybe_dump_to_stdout(config: &Config, out: &str, err: &str) {
14531453

14541454
fn error(err: &str) { println!("\nerror: {}", err); }
14551455

1456-
fn fatal(err: &str) -> ! { error(err); panic!(); }
1456+
fn fatal(err: &str) -> ! { error(err); fail!(); }
14571457

14581458
fn fatal_proc_rec(err: &str, proc_res: &ProcRes) -> ! {
14591459
print!("\n\
@@ -1471,7 +1471,7 @@ stderr:\n\
14711471
\n",
14721472
err, proc_res.status, proc_res.cmdline, proc_res.stdout,
14731473
proc_res.stderr);
1474-
panic!();
1474+
fail!();
14751475
}
14761476

14771477
fn _arm_exec_compiled_test(config: &Config,

branches/snap-stage3/src/compiletest/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn get_os(triple: &str) -> &'static str {
3131
return os
3232
}
3333
}
34-
panic!("Cannot determine OS from triple");
34+
fail!("Cannot determine OS from triple");
3535
}
3636

3737
#[cfg(target_os = "windows")]

branches/snap-stage3/src/doc/complement-bugreport.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ release: 0.12.0
4747
```
4848

4949
Finally, if you can run the offending command under gdb, pasting a stack trace can be
50-
useful; to do so, you will need to set a breakpoint on `rust_panic`.
50+
useful; to do so, you will need to set a breakpoint on `rust_fail`.
5151

5252
# I submitted a bug, but nobody has commented on it!
5353

branches/snap-stage3/src/doc/complement-design-faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ code should need to run is a stack.
9494

9595
`match` being exhaustive has some useful properties. First, if every
9696
possibility is covered by the `match`, adding further variants to the `enum`
97-
in the future will prompt a compilation failure, rather than runtime panic.
97+
in the future will prompt a compilation failure, rather than runtime failure.
9898
Second, it makes cost explicit. In general, only safe way to have a
99-
non-exhaustive match would be to panic the task if nothing is matched, though
99+
non-exhaustive match would be to fail the task if nothing is matched, though
100100
it could fall through if the type of the `match` expression is `()`. This sort
101101
of hidden cost and special casing is against the language's philosophy. It's
102102
easy to ignore certain cases by using the `_` wildcard:

branches/snap-stage3/src/doc/complement-lang-faq.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,14 @@ Data values in the language can only be constructed through a fixed set of initi
6565
* There is no global inter-crate namespace; all name management occurs within a crate.
6666
* Using another crate binds the root of _its_ namespace into the user's namespace.
6767

68-
## Why is panic unwinding non-recoverable within a task? Why not try to "catch exceptions"?
68+
## Why is failure unwinding non-recoverable within a task? Why not try to "catch exceptions"?
6969

7070
In short, because too few guarantees could be made about the dynamic environment of the catch block, as well as invariants holding in the unwound heap, to be able to safely resume; we believe that other methods of signalling and logging errors are more appropriate, with tasks playing the role of a "hard" isolation boundary between separate heaps.
7171

7272
Rust provides, instead, three predictable and well-defined options for handling any combination of the three main categories of "catch" logic:
7373

7474
* Failure _logging_ is done by the integrated logging subsystem.
75-
* _Recovery_ after a panic is done by trapping a task panic from _outside_
76-
the task, where other tasks are known to be unaffected.
75+
* _Recovery_ after a failure is done by trapping a task failure from _outside_ the task, where other tasks are known to be unaffected.
7776
* _Cleanup_ of resources is done by RAII-style objects with destructors.
7877

7978
Cleanup through RAII-style destructors is more likely to work than in catch blocks anyways, since it will be better tested (part of the non-error control paths, so executed all the time).

branches/snap-stage3/src/doc/guide-ffi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ the stack of the task which is spawned.
191191

192192
Foreign libraries often hand off ownership of resources to the calling code.
193193
When this occurs, we must use Rust's destructors to provide safety and guarantee
194-
the release of these resources (especially in the case of panic).
194+
the release of these resources (especially in the case of failure).
195195

196196
# Callbacks from C code to Rust functions
197197

branches/snap-stage3/src/doc/guide-lifetimes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ a reference.
5656
fn compute_distance(p1: &Point, p2: &Point) -> f64 {
5757
let x_d = p1.x - p2.x;
5858
let y_d = p1.y - p2.y;
59-
(x_d * x_d + y_d * y_d).sqrt()
59+
sqrt(x_d * x_d + y_d * y_d)
6060
}
6161
~~~
6262

branches/snap-stage3/src/doc/guide-macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ match x {
240240
// complicated stuff goes here
241241
return result + val;
242242
},
243-
_ => panic!("Didn't get good_2")
243+
_ => fail!("Didn't get good_2")
244244
}
245245
}
246246
_ => return 0 // default value
@@ -284,7 +284,7 @@ macro_rules! biased_match (
284284
biased_match!((x) ~ (Good1(g1, val)) else { return 0 };
285285
binds g1, val )
286286
biased_match!((g1.body) ~ (Good2(result) )
287-
else { panic!("Didn't get good_2") };
287+
else { fail!("Didn't get good_2") };
288288
binds result )
289289
// complicated stuff goes here
290290
return result + val;
@@ -397,7 +397,7 @@ macro_rules! biased_match (
397397
# fn f(x: T1) -> uint {
398398
biased_match!(
399399
(x) ~ (Good1(g1, val)) else { return 0 };
400-
(g1.body) ~ (Good2(result) ) else { panic!("Didn't get Good2") };
400+
(g1.body) ~ (Good2(result) ) else { fail!("Didn't get Good2") };
401401
binds val, result )
402402
// complicated stuff goes here
403403
return result + val;

branches/snap-stage3/src/doc/guide-plugin.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ extern crate syntax;
5555
extern crate rustc;
5656
5757
use syntax::codemap::Span;
58-
use syntax::parse::token;
58+
use syntax::parse::token::{IDENT, get_ident};
5959
use syntax::ast::{TokenTree, TtToken};
6060
use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacExpr};
6161
use syntax::ext::build::AstBuilder; // trait for expr_uint
@@ -71,7 +71,7 @@ fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
7171
("I", 1)];
7272
7373
let text = match args {
74-
[TtToken(_, token::Ident(s, _))] => token::get_ident(s).to_string(),
74+
[TtToken(_, IDENT(s, _))] => get_ident(s).to_string(),
7575
_ => {
7676
cx.span_err(sp, "argument should be a single identifier");
7777
return DummyResult::any(sp);

branches/snap-stage3/src/doc/guide-tasks.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ relates to the Rust type system, and introduce the fundamental library
88
abstractions for constructing concurrent programs.
99

1010
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust
11-
code as a result of an explicit call to `panic!()`, an assertion failure, or
11+
code as a result of an explicit call to `fail!()`, an assertion failure, or
1212
another invalid operation, the runtime system destroys the entire task. Unlike
1313
in languages such as Java and C++, there is no way to `catch` an exception.
14-
Instead, tasks may monitor each other to see if they panic.
14+
Instead, tasks may monitor each other for failure.
1515

1616
Tasks use Rust's type system to provide strong memory safety guarantees. In
1717
particular, the type system guarantees that tasks cannot induce a data race
@@ -317,19 +317,19 @@ spawn(proc() {
317317
# }
318318
```
319319

320-
# Handling task panics
320+
# Handling task failure
321321

322-
Rust has a built-in mechanism for raising exceptions. The `panic!()` macro
323-
(which can also be written with an error string as an argument: `panic!(
324-
~reason)`) and the `assert!` construct (which effectively calls `panic!()` if a
322+
Rust has a built-in mechanism for raising exceptions. The `fail!()` macro
323+
(which can also be written with an error string as an argument: `fail!(
324+
~reason)`) and the `assert!` construct (which effectively calls `fail!()` if a
325325
boolean expression is false) are both ways to raise exceptions. When a task
326326
raises an exception, the task unwinds its stack—running destructors and
327327
freeing memory along the way—and then exits. Unlike exceptions in C++,
328-
exceptions in Rust are unrecoverable within a single task: once a task panics,
328+
exceptions in Rust are unrecoverable within a single task: once a task fails,
329329
there is no way to "catch" the exception.
330330

331-
While it isn't possible for a task to recover from panicking, tasks may notify
332-
each other if they panic. The simplest way of handling a panic is with the
331+
While it isn't possible for a task to recover from failure, tasks may notify
332+
each other of failure. The simplest way of handling task failure is with the
333333
`try` function, which is similar to `spawn`, but immediately blocks and waits
334334
for the child task to finish. `try` returns a value of type
335335
`Result<T, Box<Any + Send>>`. `Result` is an `enum` type with two variants:
@@ -346,7 +346,7 @@ let result: Result<int, Box<std::any::Any + Send>> = task::try(proc() {
346346
if some_condition() {
347347
calculate_result()
348348
} else {
349-
panic!("oops!");
349+
fail!("oops!");
350350
}
351351
});
352352
assert!(result.is_err());
@@ -355,18 +355,18 @@ assert!(result.is_err());
355355
Unlike `spawn`, the function spawned using `try` may return a value, which
356356
`try` will dutifully propagate back to the caller in a [`Result`] enum. If the
357357
child task terminates successfully, `try` will return an `Ok` result; if the
358-
child task panics, `try` will return an `Error` result.
358+
child task fails, `try` will return an `Error` result.
359359

360360
[`Result`]: std/result/index.html
361361

362-
> *Note:* A panicked task does not currently produce a useful error
362+
> *Note:* A failed task does not currently produce a useful error
363363
> value (`try` always returns `Err(())`). In the
364364
> future, it may be possible for tasks to intercept the value passed to
365-
> `panic!()`.
365+
> `fail!()`.
366366
367-
But not all panics are created equal. In some cases you might need to abort
367+
But not all failures are created equal. In some cases you might need to abort
368368
the entire program (perhaps you're writing an assert which, if it trips,
369369
indicates an unrecoverable logic error); in other cases you might want to
370-
contain the panic at a certain boundary (perhaps a small piece of input from
370+
contain the failure at a certain boundary (perhaps a small piece of input from
371371
the outside world, which you happen to be processing in parallel, is malformed
372372
such that the processing task cannot proceed).

branches/snap-stage3/src/doc/guide-testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ value. To run the tests in a crate, it must be compiled with the
4949
`--test` flag: `rustc myprogram.rs --test -o myprogram-tests`. Running
5050
the resulting executable will run all the tests in the crate. A test
5151
is considered successful if its function returns; if the task running
52-
the test fails, through a call to `panic!`, a failed `assert`, or some
52+
the test fails, through a call to `fail!`, a failed `assert`, or some
5353
other (`assert_eq`, ...) means, then the test fails.
5454

5555
When compiling a crate with the `--test` flag `--cfg test` is also
@@ -77,7 +77,7 @@ test on windows you can write `#[cfg_attr(windows, ignore)]`.
7777

7878
Tests that are intended to fail can be annotated with the
7979
`should_fail` attribute. The test will be run, and if it causes its
80-
task to panic then the test will be counted as successful; otherwise it
80+
task to fail then the test will be counted as successful; otherwise it
8181
will be counted as a failure. For example:
8282

8383
~~~test_harness

0 commit comments

Comments
 (0)