Replace most invocations of fail keyword with die! macro
This commit is contained in:
parent
2db3175c76
commit
aee7929469
331 changed files with 914 additions and 908 deletions
|
|
@ -25,7 +25,7 @@ pub fn alist_get<A: Copy, B: Copy>(lst: alist<A,B>, k: A) -> B {
|
|||
for lst.data.each |entry| {
|
||||
if eq_fn(entry.key, k) { return entry.value; }
|
||||
}
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ impl methods<T:copy> for maybe<T> {
|
|||
fn ~[](idx: uint) -> T {
|
||||
match self {
|
||||
just(t) { t }
|
||||
nothing { fail; }
|
||||
nothing { die!(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,6 @@ impl bool: read {
|
|||
pub fn read<T: read Copy>(s: ~str) -> T {
|
||||
match read::readMaybe(s) {
|
||||
Some(x) => x,
|
||||
_ => fail ~"read failed!"
|
||||
_ => die!(~"read failed!")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ fn bfs2(graph: graph, key: node_id) -> bfs_result {
|
|||
match *c {
|
||||
white => { -1i64 }
|
||||
black(parent) => { parent }
|
||||
_ => { fail ~"Found remaining gray nodes in BFS" }
|
||||
_ => { die!(~"Found remaining gray nodes in BFS") }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -294,7 +294,7 @@ fn pbfs(&&graph: arc::ARC<graph>, key: node_id) -> bfs_result {
|
|||
match *c {
|
||||
white => { -1i64 }
|
||||
black(parent) => { parent }
|
||||
_ => { fail ~"Found remaining gray nodes in BFS" }
|
||||
_ => { die!(~"Found remaining gray nodes in BFS") }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ macro_rules! follow (
|
|||
$(Some($message($($x,)* move next)) => {
|
||||
let $next = move next;
|
||||
move $e })+
|
||||
_ => { fail }
|
||||
_ => { die!() }
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ macro_rules! follow (
|
|||
$(Some($message(move next)) => {
|
||||
let $next = move next;
|
||||
move $e })+
|
||||
_ => { fail }
|
||||
_ => { die!() }
|
||||
}
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ pub fn solve_grid(g: grid_t) {
|
|||
ptr = ptr + 1u;
|
||||
} else {
|
||||
// no: redo this field aft recoloring pred; unless there is none
|
||||
if ptr == 0u { fail ~"No solution found for this sudoku"; }
|
||||
if ptr == 0u { die!(~"No solution found for this sudoku"); }
|
||||
ptr = ptr - 1u;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ fn r(l: @nillist) -> r {
|
|||
fn recurse_or_fail(depth: int, st: Option<State>) {
|
||||
if depth == 0 {
|
||||
debug!("unwinding %.4f", precise_time_s());
|
||||
fail;
|
||||
die!();
|
||||
} else {
|
||||
let depth = depth - 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,6 @@ fn main() {
|
|||
let (p,c) = pipes::stream();
|
||||
child_generation(uint::from_str(args[1]).get(), move c);
|
||||
if p.try_recv().is_none() {
|
||||
fail ~"it happened when we slumbered";
|
||||
die!(~"it happened when we slumbered");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ fn main() {
|
|||
}
|
||||
// Grandparent group waits for middle group to be gone, then fails
|
||||
error!("Grandparent group wakes up and fails");
|
||||
fail;
|
||||
die!();
|
||||
};
|
||||
assert x.is_err();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// a good test that we merge paths correctly in the presence of a
|
||||
// variable that's used before it's declared
|
||||
|
||||
fn my_fail() -> ! { fail; }
|
||||
fn my_fail() -> ! { die!(); }
|
||||
|
||||
fn main() {
|
||||
match true { false => { my_fail(); } true => { } }
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
// Tests that a function with a ! annotation always actually fails
|
||||
|
||||
fn bad_bang(i: uint) -> ! {
|
||||
if i < 0u { } else { fail; }
|
||||
if i < 0u { } else { die!(); }
|
||||
//~^ ERROR expected `!` but found `()`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@ fn main() {
|
|||
let x = Some(X { x: () });
|
||||
match move x {
|
||||
Some(ref _y @ move _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern
|
||||
None => fail
|
||||
None => die!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@ fn main() {
|
|||
let x = Some((X { x: () }, X { x: () }));
|
||||
match move x {
|
||||
Some((ref _y, move _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern
|
||||
None => fail
|
||||
None => die!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@ fn main() {
|
|||
let x = some2(X { x: () }, X { x: () });
|
||||
match move x {
|
||||
some2(ref _y, move _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern
|
||||
none2 => fail
|
||||
none2 => die!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@ fn main() {
|
|||
let x = Some((X { x: () }, X { x: () }));
|
||||
match move x {
|
||||
Some((move _y, ref _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern
|
||||
None => fail
|
||||
None => die!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ fn main() {
|
|||
let x = Some(p);
|
||||
c.send(false);
|
||||
match move x {
|
||||
Some(move z) if z.recv() => { fail }, //~ ERROR cannot bind by-move into a pattern guard
|
||||
Some(move z) if z.recv() => { die!() }, //~ ERROR cannot bind by-move into a pattern guard
|
||||
Some(move z) => { assert !z.recv(); },
|
||||
None => fail
|
||||
None => die!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@ fn main() {
|
|||
let x = Some(X { x: () });
|
||||
match x {
|
||||
Some(move _z) => { }, //~ ERROR cannot bind by-move when matching an lvalue
|
||||
None => fail
|
||||
None => die!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,6 @@ fn main() {
|
|||
let x = Y { y: Some(X { x: () }) };
|
||||
match x.y {
|
||||
Some(move _z) => { }, //~ ERROR cannot bind by-move when matching an lvalue
|
||||
None => fail
|
||||
None => die!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@ fn main() {
|
|||
let x = Some(X { x: () });
|
||||
match move x {
|
||||
Some(move _y @ ref _z) => { }, //~ ERROR cannot bind by-move with sub-bindings
|
||||
None => fail
|
||||
None => die!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ fn main() {
|
|||
x = X(Left((0,0))); //~ ERROR assigning to captured outer mutable variable
|
||||
(*f)()
|
||||
},
|
||||
_ => fail
|
||||
_ => die!()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use core::either::{Either, Left, Right};
|
|||
*x = Right(1.0);
|
||||
*z
|
||||
}
|
||||
_ => fail
|
||||
_ => die!()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ fn main() {
|
|||
Some(ref m) => {
|
||||
msg = m;
|
||||
},
|
||||
None => { fail }
|
||||
None => { die!() }
|
||||
}
|
||||
io::println(*msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@ fn foo(f: fn() -> !) {}
|
|||
|
||||
fn main() {
|
||||
// Type inference didn't use to be able to handle this:
|
||||
foo(|| fail);
|
||||
foo(|| die!());
|
||||
foo(|| 22); //~ ERROR mismatched types
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@
|
|||
// error-pattern:cannot be dereferenced
|
||||
fn main() {
|
||||
match *1 {
|
||||
_ => { fail; }
|
||||
_ => { die!(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@
|
|||
|
||||
// error-pattern:mismatched types
|
||||
|
||||
fn main() { fail 5; }
|
||||
fn main() { die!(5); }
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@
|
|||
|
||||
// error-pattern:unexpected token
|
||||
fn main() {
|
||||
fail @ ;
|
||||
die!(@);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,4 +9,4 @@
|
|||
// except according to those terms.
|
||||
|
||||
// error-pattern:expected `~str` but found `~[int]`
|
||||
fn main() { fail ~[0i]; }
|
||||
fn main() { die!(~[0i]); }
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ trait vec_monad<A> {
|
|||
|
||||
impl<A> ~[A]: vec_monad<A> {
|
||||
fn bind<B>(f: fn(A) -> ~[B]) {
|
||||
let mut r = fail;
|
||||
let mut r = die!();
|
||||
for self.each |elt| { r += f(*elt); }
|
||||
//~^ WARNING unreachable expression
|
||||
//~^^ ERROR the type of this value must be known
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn fail_len(v: ~[const int]) -> uint {
|
||||
let mut i = fail;
|
||||
let mut i = die!();
|
||||
for v.each |x| { i += 1u; }
|
||||
//~^ WARNING unreachable statement
|
||||
//~^^ ERROR the type of this value must be known
|
||||
return i;
|
||||
}
|
||||
fn main() {}
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ trait channel<T> {
|
|||
|
||||
// `chan` is not a trait, it's an enum
|
||||
impl int: chan { //~ ERROR can only implement trait types
|
||||
fn send(v: int) { fail }
|
||||
fn send(v: int) { die!() }
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@
|
|||
*/
|
||||
fn foo() { //~ ERROR this open brace is not closed
|
||||
match Some(x) {
|
||||
Some(y) { fail; }
|
||||
None { fail; }
|
||||
Some(y) { die!(); }
|
||||
None { die!(); }
|
||||
}
|
||||
|
||||
fn bar() {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ struct E {
|
|||
}
|
||||
|
||||
impl E: A {
|
||||
fn b<F:Copy, G>(_x: F) -> F { fail } //~ ERROR in method `b`, type parameter 0 has 1 bound, but
|
||||
fn b<F:Copy, G>(_x: F) -> F { die!() } //~ ERROR in method `b`, type parameter 0 has 1 bound, but
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ struct E {
|
|||
}
|
||||
|
||||
impl E: A {
|
||||
fn b<F:Copy Const, G>(_x: F) -> F { fail } //~ ERROR in method `b`, type parameter 0 has 2 bounds, but
|
||||
fn b<F:Copy Const, G>(_x: F) -> F { die!() } //~ ERROR in method `b`, type parameter 0 has 2 bounds, but
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ struct E {
|
|||
|
||||
impl E: A {
|
||||
// n.b. The error message is awful -- see #3404
|
||||
fn b<F:Copy, G>(_x: G) -> G { fail } //~ ERROR method `b` has an incompatible type
|
||||
fn b<F:Copy, G>(_x: G) -> G { die!() } //~ ERROR method `b` has an incompatible type
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn uuid() -> uint { fail; }
|
||||
fn uuid() -> uint { die!(); }
|
||||
|
||||
fn from_str(s: ~str) -> uint { fail; }
|
||||
fn to_str(u: uint) -> ~str { fail; }
|
||||
fn uuid_random() -> uint { fail; }
|
||||
fn from_str(s: ~str) -> uint { die!(); }
|
||||
fn to_str(u: uint) -> ~str { die!(); }
|
||||
fn uuid_random() -> uint { die!(); }
|
||||
|
||||
fn main() {
|
||||
do uint::range(0, 100000) |_i| { //~ ERROR Do-block body must return bool, but
|
||||
|
|
@ -22,4 +22,4 @@ fn main() {
|
|||
do uint::range(0, 100000) |_i| { //~ ERROR mismatched types
|
||||
~"str"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ fn siphash(k0 : u64) -> siphash {
|
|||
//~^ ERROR unresolved name: k0
|
||||
}
|
||||
}
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ fn main() {
|
|||
~Element(ed) => match ed.kind {
|
||||
~HTMLImageElement(d) if d.image.is_some() => { true }
|
||||
},
|
||||
_ => fail ~"WAT" //~ ERROR wat
|
||||
_ => die!(~"WAT") //~ ERROR wat
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ trait PTrait {
|
|||
impl P: PTrait {
|
||||
fn getChildOption() -> Option<@P> {
|
||||
const childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn g() -> ! { fail; }
|
||||
fn g() -> ! { die!(); }
|
||||
fn f() -> ! {
|
||||
return 42i; //~ ERROR expected `!` but found `int`
|
||||
g(); //~ WARNING unreachable statement
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
fn f() -> ! {
|
||||
return 42i; //~ ERROR expected `!` but found `int`
|
||||
fail; //~ WARNING unreachable statement
|
||||
die!(); //~ WARNING unreachable statement
|
||||
}
|
||||
fn main() { }
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
fn send<T: Owned>(ch: _chan<T>, -data: T) {
|
||||
log(debug, ch);
|
||||
log(debug, data);
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
enum _chan<T> = int;
|
||||
|
|
@ -23,4 +23,4 @@ fn test00_start(ch: _chan<~int>, message: ~int, _count: ~int) {
|
|||
log(debug, message); //~ ERROR use of moved value: `message`
|
||||
}
|
||||
|
||||
fn main() { fail; }
|
||||
fn main() { die!(); }
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ enum u { c, d }
|
|||
fn main() {
|
||||
let x = a(c);
|
||||
match x {
|
||||
a(d) => { fail ~"hello"; }
|
||||
b => { fail ~"goodbye"; }
|
||||
a(d) => { die!(~"hello"); }
|
||||
b => { die!(~"goodbye"); }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,6 @@ fn main() {
|
|||
Some(copy z) => { //~ ERROR copying a noncopyable value
|
||||
do z.with |b| { assert !*b; }
|
||||
}
|
||||
None => fail
|
||||
None => die!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
// unrelated errors.
|
||||
|
||||
fn foo(a: int, b: int, c: int, d:int) {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,6 @@ use option::Some;
|
|||
|
||||
enum bar { t1((), Option<~[int]>), t2, }
|
||||
|
||||
fn foo(t: bar) -> int { match t { t1(_, Some(x)) => { return x * 3; } _ => { fail; } } }
|
||||
fn foo(t: bar) -> int { match t { t1(_, Some(x)) => { return x * 3; } _ => { die!(); } } }
|
||||
|
||||
fn main() { }
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ fn foo(t: bar) {
|
|||
t1(_, Some::<int>(x)) => {
|
||||
log(debug, x);
|
||||
}
|
||||
_ => { fail; }
|
||||
_ => { die!(); }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,6 @@ fn main() {
|
|||
}
|
||||
|
||||
fn check_pp<T>(expr: T, f: fn(pprust::ps, T), expect: str) {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,6 @@ fn main() {
|
|||
}
|
||||
|
||||
fn check_pp<T>(expr: T, f: fn(pprust::ps, T), expect: str) {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn of<T>() -> @fn(T) { fail; }
|
||||
fn subtype<T>(x: @fn(T)) { fail; }
|
||||
fn of<T>() -> @fn(T) { die!(); }
|
||||
fn subtype<T>(x: @fn(T)) { die!(); }
|
||||
|
||||
fn test_fn<T>(_x: &x/T, _y: &y/T, _z: &z/T) {
|
||||
// Here, x, y, and z are free. Other letters
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn of<T>() -> @fn(T) { fail; }
|
||||
fn subtype<T>(x: @fn(T)) { fail; }
|
||||
fn of<T>() -> @fn(T) { die!(); }
|
||||
fn subtype<T>(x: @fn(T)) { die!(); }
|
||||
|
||||
fn test_fn<T>(_x: &x/T, _y: &y/T, _z: &z/T) {
|
||||
// Here, x, y, and z are free. Other letters
|
||||
|
|
@ -54,4 +54,4 @@ fn test_fn<T>(_x: &x/T, _y: &y/T, _z: &z/T) {
|
|||
of::<fn(&a/T) -> @fn(&a/T)>());
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
extern mod core;
|
||||
|
||||
fn last<T>(v: ~[const &T]) -> core::Option<T> {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@ enum quux<T> { bar }
|
|||
|
||||
fn foo(c: quux) { assert (false); }
|
||||
|
||||
fn main() { fail; }
|
||||
fn main() { die!(); }
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@ extern mod xx {
|
|||
|
||||
fn main() {
|
||||
// let it fail to verify warning message
|
||||
fail
|
||||
die!()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn f() { if (1 == fail) { } else { } }
|
||||
fn f() { if (1 == die!()) { } else { } }
|
||||
|
||||
fn main() { }
|
||||
fn main() { }
|
||||
|
|
|
|||
|
|
@ -14,6 +14,6 @@ fn foo(s: ~str) { }
|
|||
|
||||
fn main() {
|
||||
let i =
|
||||
match Some::<int>(3) { None::<int> => { fail } Some::<int>(_) => { fail } };
|
||||
match Some::<int>(3) { None::<int> => { die!() } Some::<int>(_) => { die!() } };
|
||||
foo(i);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
// error-pattern:quux
|
||||
fn f() -> ! { fail ~"quux" }
|
||||
fn f() -> ! { die!(~"quux") }
|
||||
fn g() -> int { match f() { true => { 1 } false => { 0 } } }
|
||||
fn main() { g(); }
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@
|
|||
// error-pattern:squirrelcupcake
|
||||
fn cmp() -> int {
|
||||
match (option::Some('a'), option::None::<char>) {
|
||||
(option::Some(_), _) => { fail ~"squirrelcupcake"; }
|
||||
(_, option::Some(_)) => { fail; }
|
||||
_ => { fail ~"wat"; }
|
||||
(option::Some(_), _) => { die!(~"squirrelcupcake"); }
|
||||
(_, option::Some(_)) => { die!(); }
|
||||
_ => { die!(~"wat"); }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
// error-pattern:meep
|
||||
fn f(a: int, b: int, c: @int) { fail ~"moop"; }
|
||||
fn f(a: int, b: int, c: @int) { die!(~"moop"); }
|
||||
|
||||
fn main() { f(1, fail ~"meep", @42); }
|
||||
fn main() { f(1, die!(~"meep"), @42); }
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
// error-pattern:quux
|
||||
fn my_err(s: ~str) -> ! { log(error, s); fail ~"quux"; }
|
||||
fn my_err(s: ~str) -> ! { log(error, s); die!(~"quux"); }
|
||||
fn main() { 3u == my_err(~"bye"); }
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
// error-pattern:quux
|
||||
fn my_err(s: ~str) -> ! { log(error, s); fail ~"quux"; }
|
||||
fn my_err(s: ~str) -> ! { log(error, s); die!(~"quux"); }
|
||||
fn main() { 3u == my_err(~"bye"); }
|
||||
|
|
|
|||
|
|
@ -16,6 +16,6 @@ type port_id = int;
|
|||
|
||||
enum chan_t<T> = {task: task_id, port: port_id};
|
||||
|
||||
fn send<T: Owned>(ch: chan_t<T>, data: T) { fail; }
|
||||
fn send<T: Owned>(ch: chan_t<T>, data: T) { die!(); }
|
||||
|
||||
fn main() { fail ~"quux"; }
|
||||
fn main() { die!(~"quux"); }
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
//error-pattern:One
|
||||
fn main() {
|
||||
fail ~"One";
|
||||
fail ~"Two";
|
||||
}
|
||||
die!(~"One");
|
||||
die!(~"Two");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,5 +10,5 @@
|
|||
|
||||
// error-pattern:wooooo
|
||||
fn main() {
|
||||
let mut a = 1; if 1 == 1 { a = 2; } fail ~"woooo" + ~"o";
|
||||
let mut a = 1; if 1 == 1 { a = 2; } die!(~"woooo" + ~"o");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@
|
|||
|
||||
|
||||
// error-pattern:explicit
|
||||
fn main() { fail; }
|
||||
fn main() { die!(); }
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
|
||||
// error-pattern:explicit failure
|
||||
fn f() -> ! { fail }
|
||||
fn f() -> ! { die!() }
|
||||
|
||||
fn g() -> int { let x = match true { true => { f() } false => { 10 } }; return x; }
|
||||
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@
|
|||
|
||||
|
||||
// error-pattern:explicit failure
|
||||
fn main() { let x = match true { false => { 0 } true => { fail } }; }
|
||||
fn main() { let x = match true { false => { 0 } true => { die!() } }; }
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@
|
|||
|
||||
|
||||
// error-pattern:explicit failure
|
||||
fn f() -> ! { fail }
|
||||
fn f() -> ! { die!() }
|
||||
|
||||
fn main() { f(); }
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
|
||||
// error-pattern:explicit failure
|
||||
fn f() -> ! { fail }
|
||||
fn f() -> ! { die!() }
|
||||
|
||||
fn g() -> int { let x = if true { f() } else { 10 }; return x; }
|
||||
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@
|
|||
|
||||
|
||||
// error-pattern:explicit failure
|
||||
fn main() { let x = if false { 0 } else if true { fail } else { 10 }; }
|
||||
fn main() { let x = if false { 0 } else if true { die!() } else { 10 }; }
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ fn main() {
|
|||
do task::spawn {
|
||||
let result = count(5u);
|
||||
debug!("result = %?", result);
|
||||
fail;
|
||||
die!();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@
|
|||
|
||||
// error-pattern:moop
|
||||
extern mod std;
|
||||
fn main() { fail ~"moop"; }
|
||||
fn main() { die!(~"moop"); }
|
||||
|
|
|
|||
|
|
@ -11,4 +11,4 @@
|
|||
// error-pattern:meh
|
||||
extern mod std;
|
||||
|
||||
fn main() { let str_var: ~str = ~"meh"; fail fmt!("%s", str_var); }
|
||||
fn main() { let str_var: ~str = ~"meh"; die!(fmt!("%s", str_var)); }
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@
|
|||
|
||||
// error-pattern:moop
|
||||
extern mod std;
|
||||
fn main() { for uint::range(0u, 10u) |_i| { fail ~"moop"; } }
|
||||
fn main() { for uint::range(0u, 10u) |_i| { die!(~"moop"); } }
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ fn foo(x: uint) {
|
|||
if even(x) {
|
||||
log(debug, x);
|
||||
} else {
|
||||
fail ~"Number is odd";
|
||||
die!(~"Number is odd");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
// error-pattern:quux
|
||||
fn my_err(s: ~str) -> ! { log(error, s); fail ~"quux"; }
|
||||
fn my_err(s: ~str) -> ! { log(error, s); die!(~"quux"); }
|
||||
fn main() { if my_err(~"bye") { } }
|
||||
|
|
|
|||
|
|
@ -15,6 +15,6 @@ use io::ReaderUtil;
|
|||
|
||||
fn main() {
|
||||
do io::with_str_reader(~"") |rdr| {
|
||||
match rdr.read_char() { '=' => { } _ => { fail } }
|
||||
match rdr.read_char() { '=' => { } _ => { die!() } }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,5 +22,5 @@ fn main() {
|
|||
},
|
||||
a: ~0
|
||||
};
|
||||
fail;
|
||||
}
|
||||
die!();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// error-pattern:so long
|
||||
fn main() {
|
||||
let x = ~[], y = ~[3];
|
||||
fail ~"so long";
|
||||
die!(~"so long");
|
||||
x += y;
|
||||
~"good" + ~"bye";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
// error-pattern:fail
|
||||
|
||||
fn child() { fail; }
|
||||
fn child() { die!(); }
|
||||
|
||||
fn main() {
|
||||
let (p, _c) = pipes::stream::<()>();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
// error-pattern:fail
|
||||
|
||||
fn grandchild() { fail ~"grandchild dies"; }
|
||||
fn grandchild() { die!(~"grandchild dies"); }
|
||||
|
||||
fn child() {
|
||||
let (p, _c) = pipes::stream::<int>();
|
||||
|
|
|
|||
|
|
@ -8,15 +8,15 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:explicit failure
|
||||
// error-pattern:fail
|
||||
fn getbig(i: int) {
|
||||
if i != 0 {
|
||||
getbig(i - 1);
|
||||
} else {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
getbig(100000);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ fn getbig_call_c_and_fail(i: int) {
|
|||
} else {
|
||||
unsafe {
|
||||
rustrt::last_os_error();
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ fn getbig_and_fail(&&i: int) {
|
|||
if i != 0 {
|
||||
getbig_and_fail(i - 1);
|
||||
} else {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ fn getbig_and_fail(&&i: int) {
|
|||
if i != 0 {
|
||||
getbig_and_fail(i - 1);
|
||||
} else {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
struct T { t: ~str }
|
||||
|
||||
fn main() { let pth = fail ~"bye"; let rs: T = T {t: pth}; }
|
||||
fn main() { let pth = die!(~"bye"); let rs: T = T {t: pth}; }
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
// error-pattern:[...]
|
||||
|
||||
fn main() {
|
||||
fail ~"\
|
||||
die!(~"\
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
|
||||
|
|
@ -70,5 +70,5 @@ fn main() {
|
|||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
|
||||
";
|
||||
");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@ fn main() {
|
|||
// normally. In this case we're going to fail, so instead of of
|
||||
// returning 50 the process will return the typical rt failure code.
|
||||
os::set_exit_status(50);
|
||||
fail;
|
||||
}
|
||||
die!();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,5 +34,5 @@ fn main() {
|
|||
do task::spawn {
|
||||
let i = r(5);
|
||||
};
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,5 +17,5 @@ mod m {
|
|||
pub fn exported() { }
|
||||
|
||||
#[test]
|
||||
fn unexported() { fail ~"runned an unexported test"; }
|
||||
fn unexported() { die!(~"runned an unexported test"); }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ extern mod std;
|
|||
// We don't want to see any invalid reads
|
||||
fn main() {
|
||||
fn f() {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
task::spawn(|| f() );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
fn goodfail() {
|
||||
task::yield();
|
||||
fail ~"goodfail";
|
||||
die!(~"goodfail");
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ fn test_box() {
|
|||
}
|
||||
fn test_str() {
|
||||
let res = match false { true => { ~"happy" },
|
||||
_ => fail ~"non-exhaustive match failure" };
|
||||
_ => die!(~"non-exhaustive match failure") };
|
||||
assert res == ~"happy";
|
||||
}
|
||||
fn main() {
|
||||
test_box();
|
||||
test_str();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// error-pattern:fail
|
||||
|
||||
fn failfn() {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// error-pattern:fail
|
||||
|
||||
fn failfn() {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// error-pattern:fail
|
||||
|
||||
fn failfn() {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
struct r {
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@
|
|||
// error-pattern:fail
|
||||
|
||||
fn failfn() {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = @~"hi";
|
||||
failfn();
|
||||
log(error, x);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// error-pattern:fail
|
||||
|
||||
fn failfn() {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
trait i {
|
||||
|
|
@ -26,4 +26,4 @@ fn main() {
|
|||
let x = ~0 as i;
|
||||
failfn();
|
||||
log(error, x);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@
|
|||
// error-pattern:fail
|
||||
|
||||
fn failfn() {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = @~~0;
|
||||
failfn();
|
||||
log(error, x);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@
|
|||
// error-pattern:fail
|
||||
|
||||
fn failfn() {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = @~0;
|
||||
failfn();
|
||||
log(error, x);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@
|
|||
// error-pattern:fail
|
||||
|
||||
fn failfn() {
|
||||
fail;
|
||||
die!();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = @~[0, 1, 2, 3, 4, 5];
|
||||
failfn();
|
||||
log(error, x);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue