Replace most invocations of fail keyword with die! macro

This commit is contained in:
Nick Desaulniers 2013-01-31 17:51:01 -08:00
parent adb9d0e8a1
commit 6fb4239bb3
22 changed files with 49 additions and 49 deletions

View file

@ -9,5 +9,5 @@
// except according to those terms.
pub unsafe fn f(xs: ~[int]) {
xs.map(|_x| { unsafe fn q() { fail; } });
xs.map(|_x| { unsafe fn q() { die!(); } });
}

View file

@ -68,7 +68,7 @@ fn parse_opts(argv: ~[~str]) -> Config {
Ok(ref m) => {
return Config {stress: getopts::opt_present(m, ~"stress")}
}
Err(_) => { fail; }
Err(_) => { die!(); }
}
}

View file

@ -2,7 +2,7 @@ fn a() -> &[int] {
let vec = [1, 2, 3, 4];
let tail = match vec { //~ ERROR illegal borrow
[_a, ..tail] => tail,
_ => fail ~"foo"
_ => die!(~"foo")
};
move tail
}

View file

@ -2,7 +2,7 @@ fn a() -> &int {
let vec = [1, 2, 3, 4];
let tail = match vec { //~ ERROR illegal borrow
[_a, ..tail] => &tail[0],
_ => fail ~"foo"
_ => die!(~"foo")
};
move tail
}

View file

@ -21,5 +21,5 @@ fn main() {
// We shouldn't be able to get past this recv since there's no
// message available
let i: int = po.recv();
fail ~"badfail";
die!(~"badfail");
}