diff options
| author | bors <bors@rust-lang.org> | 2014-10-29 20:16:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-29 20:16:57 +0000 |
| commit | 77f44d4a7bf14805fda5fc41310a6aeffda30fd4 (patch) | |
| tree | aea7012d4afbf278ae64ce92cff06c3d2a7e00cc /src/test | |
| parent | 4769bca1483839ff9c0ad8353c206d6ee06c50e1 (diff) | |
| parent | 6ac7fc73f5acfe30c698ea4f8bfc37b30473977e (diff) | |
| download | rust-77f44d4a7bf14805fda5fc41310a6aeffda30fd4.tar.gz rust-77f44d4a7bf14805fda5fc41310a6aeffda30fd4.zip | |
auto merge of #17894 : steveklabnik/rust/fail_to_panic, r=aturon
This in-progress PR implements https://github.com/rust-lang/rust/issues/17489. I made the code changes in this commit, next is to go through alllllllll the documentation and fix various things. - Rename column headings as appropriate, `# Panics` for panic conditions and `# Errors` for `Result`s. - clean up usage of words like 'fail' in error messages Anything else to add to the list, @aturon ? I think I should leave the actual functions with names like `slice_or_fail` alone, since you'll get to those in your conventions work? I'm submitting just the code bits now so that we can see it separately, and I also don't want to have to keep re-building rust over and over again if I don't have to :wink: Listing all the bits so I can remember as I go: - [x] compiler-rt - [x] compiletest - [x] doc - [x] driver - [x] etc - [x] grammar - [x] jemalloc - [x] liballoc - [x] libarena - [x] libbacktrace - [x] libcollections - [x] libcore - [x] libcoretest - [x] libdebug - [x] libflate - [x] libfmt_macros - [x] libfourcc - [x] libgetopts - [x] libglob - [x] libgraphviz - [x] libgreen - [x] libhexfloat - [x] liblibc - [x] liblog - [x] libnative - [x] libnum - [x] librand - [x] librbml - [x] libregex - [x] libregex_macros - [x] librlibc - [x] librustc - [x] librustc_back - [x] librustc_llvm - [x] librustdoc - [x] librustrt - [x] libsemver - [x] libserialize - [x] libstd - [x] libsync - [x] libsyntax - [x] libterm - [x] libtest - [x] libtime - [x] libunicode - [x] liburl - [x] libuuid - [x] llvm - [x] rt - [x] test
Diffstat (limited to 'src/test')
295 files changed, 544 insertions, 555 deletions
diff --git a/src/test/auxiliary/cci_nested_lib.rs b/src/test/auxiliary/cci_nested_lib.rs index bbaf7991fd3..44d001d45fd 100644 --- a/src/test/auxiliary/cci_nested_lib.rs +++ b/src/test/auxiliary/cci_nested_lib.rs @@ -38,7 +38,7 @@ pub fn alist_get<A:Clone + 'static, return entry.value.clone(); } } - fail!(); + panic!(); } #[inline] diff --git a/src/test/auxiliary/issue_2723_a.rs b/src/test/auxiliary/issue_2723_a.rs index 16b743baa3d..bd8857ceef7 100644 --- a/src/test/auxiliary/issue_2723_a.rs +++ b/src/test/auxiliary/issue_2723_a.rs @@ -10,5 +10,5 @@ pub unsafe fn f(xs: Vec<int> ) { - xs.iter().map(|_x| { unsafe fn q() { fail!(); } }).collect::<Vec<()>>(); + xs.iter().map(|_x| { unsafe fn q() { panic!(); } }).collect::<Vec<()>>(); } diff --git a/src/test/auxiliary/lang-item-public.rs b/src/test/auxiliary/lang-item-public.rs index 967f49924d4..ea2461ccfa8 100644 --- a/src/test/auxiliary/lang-item-public.rs +++ b/src/test/auxiliary/lang-item-public.rs @@ -14,8 +14,8 @@ #[lang="sized"] pub trait Sized for Sized? {} -#[lang="fail"] -fn fail(_: &(&'static str, &'static str, uint)) -> ! { loop {} } +#[lang="panic"] +fn panic(_: &(&'static str, &'static str, uint)) -> ! { loop {} } #[lang = "stack_exhausted"] extern fn stack_exhausted() {} diff --git a/src/test/auxiliary/logging_right_crate.rs b/src/test/auxiliary/logging_right_crate.rs index 6bc5b677a27..fad70a91798 100644 --- a/src/test/auxiliary/logging_right_crate.rs +++ b/src/test/auxiliary/logging_right_crate.rs @@ -12,6 +12,6 @@ #[phase(plugin, link)] extern crate log; pub fn foo<T>() { - fn death() -> int { fail!() } + fn death() -> int { panic!() } debug!("{}", (||{ death() })()); } diff --git a/src/test/auxiliary/regions-bounded-method-type-parameters-cross-crate-lib.rs b/src/test/auxiliary/regions-bounded-method-type-parameters-cross-crate-lib.rs index 000e42b9703..9c0716e2cc2 100644 --- a/src/test/auxiliary/regions-bounded-method-type-parameters-cross-crate-lib.rs +++ b/src/test/auxiliary/regions-bounded-method-type-parameters-cross-crate-lib.rs @@ -36,7 +36,7 @@ pub trait IntoMaybeOwned<'a> { } impl<'a> IntoMaybeOwned<'a> for Inv<'a> { - fn into_maybe_owned(self) -> MaybeOwned<'a> { fail!() } - fn into_inv(self) -> Inv<'a> { fail!() } - fn bigger_region<'b:'a>(self, b: Inv<'b>) { fail!() } + fn into_maybe_owned(self) -> MaybeOwned<'a> { panic!() } + fn into_inv(self) -> Inv<'a> { panic!() } + fn bigger_region<'b:'a>(self, b: Inv<'b>) { panic!() } } diff --git a/src/test/auxiliary/static-methods-crate.rs b/src/test/auxiliary/static-methods-crate.rs index eef2fdbfea9..811d8f11692 100644 --- a/src/test/auxiliary/static-methods-crate.rs +++ b/src/test/auxiliary/static-methods-crate.rs @@ -36,6 +36,6 @@ impl read for bool { pub fn read<T:read>(s: String) -> T { match read::readMaybe(s) { Some(x) => x, - _ => fail!("read failed!") + _ => panic!("read panicked!") } } diff --git a/src/test/auxiliary/weak-lang-items.rs b/src/test/auxiliary/weak-lang-items.rs index c998e362d7e..6a1f8588b60 100644 --- a/src/test/auxiliary/weak-lang-items.rs +++ b/src/test/auxiliary/weak-lang-items.rs @@ -28,7 +28,7 @@ impl core::ops::Drop for A { pub fn foo() { let _a = A; - fail!("wut"); + panic!("wut"); } mod std { diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs index 404e2e31b05..39057215b5e 100644 --- a/src/test/bench/core-std.rs +++ b/src/test/bench/core-std.rs @@ -145,7 +145,7 @@ fn is_utf8_ascii() { for _ in range(0u, 20000) { v.push('b' as u8); if !str::is_utf8(v.as_slice()) { - fail!("is_utf8 failed"); + panic!("is_utf8 panicked"); } } } @@ -156,7 +156,7 @@ fn is_utf8_multibyte() { for _ in range(0u, 5000) { v.push_all(s.as_bytes()); if !str::is_utf8(v.as_slice()) { - fail!("is_utf8 failed"); + panic!("is_utf8 panicked"); } } } diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs index 4ed0de2a138..abcd9f90333 100644 --- a/src/test/bench/shootout-chameneos-redux.rs +++ b/src/test/bench/shootout-chameneos-redux.rs @@ -90,7 +90,7 @@ fn show_digit(nn: uint) -> &'static str { 7 => {" seven"} 8 => {" eight"} 9 => {" nine"} - _ => {fail!("expected digits from 0 to 9...")} + _ => {panic!("expected digits from 0 to 9...")} } } diff --git a/src/test/bench/shootout-k-nucleotide.rs b/src/test/bench/shootout-k-nucleotide.rs index 1799504eb47..d0e6aacdbb2 100644 --- a/src/test/bench/shootout-k-nucleotide.rs +++ b/src/test/bench/shootout-k-nucleotide.rs @@ -225,7 +225,7 @@ fn pack_symbol(c: u8) -> u8 { 'C' => 1, 'G' => 2, 'T' => 3, - _ => fail!("{}", c as char), + _ => panic!("{}", c as char), } } diff --git a/src/test/bench/shootout-meteor.rs b/src/test/bench/shootout-meteor.rs index 8e837864185..6e80c07a1a2 100644 --- a/src/test/bench/shootout-meteor.rs +++ b/src/test/bench/shootout-meteor.rs @@ -207,7 +207,7 @@ fn get_id(m: u64) -> u8 { for id in range(0u8, 10) { if m & (1 << (id + 50) as uint) != 0 {return id;} } - fail!("{:016x} does not have a valid identifier", m); + panic!("{:016x} does not have a valid identifier", m); } // Converts a list of mask to a Vec<u8>. diff --git a/src/test/bench/shootout-pfib.rs b/src/test/bench/shootout-pfib.rs index 91b9e058e8f..425b2e3e714 100644 --- a/src/test/bench/shootout-pfib.rs +++ b/src/test/bench/shootout-pfib.rs @@ -61,7 +61,7 @@ fn parse_opts(argv: Vec<String> ) -> Config { Ok(ref m) => { return Config {stress: m.opt_present("stress")} } - Err(_) => { fail!(); } + Err(_) => { panic!(); } } } diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs index 01c412c6d31..ae7594ea8a2 100644 --- a/src/test/bench/sudoku.rs +++ b/src/test/bench/sudoku.rs @@ -83,7 +83,7 @@ impl Sudoku { from_str::<uint>(comps[2]).unwrap() as u8; } else { - fail!("Invalid sudoku file"); + panic!("Invalid sudoku file"); } } return Sudoku::new(g) @@ -123,7 +123,7 @@ impl Sudoku { 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 { panic!("No solution found for this sudoku"); } ptr = ptr - 1u; } } diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index bdeee5fb6e0..5d96c90197c 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -39,7 +39,7 @@ fn run(repeat: int, depth: int) { for _ in range(0, repeat) { println!("starting {:.4f}", precise_time_s()); task::try(proc() { - recurse_or_fail(depth, None) + recurse_or_panic(depth, None) }); println!("stopping {:.4f}", precise_time_s()); } @@ -70,10 +70,10 @@ fn r(l: Box<nillist>) -> r { } } -fn recurse_or_fail(depth: int, st: Option<State>) { +fn recurse_or_panic(depth: int, st: Option<State>) { if depth == 0 { println!("unwinding {:.4f}", precise_time_s()); - fail!(); + panic!(); } else { let depth = depth - 1; @@ -96,6 +96,6 @@ fn recurse_or_fail(depth: int, st: Option<State>) { } }; - recurse_or_fail(depth, Some(st)); + recurse_or_panic(depth, Some(st)); } } diff --git a/src/test/bench/task-perf-jargon-metal-smoke.rs b/src/test/bench/task-perf-jargon-metal-smoke.rs index 9ebdbf0682d..3d2822e1459 100644 --- a/src/test/bench/task-perf-jargon-metal-smoke.rs +++ b/src/test/bench/task-perf-jargon-metal-smoke.rs @@ -51,6 +51,6 @@ fn main() { let (tx, rx) = channel(); child_generation(from_str::<uint>(args[1].as_slice()).unwrap(), tx); if rx.recv_opt().is_err() { - fail!("it happened when we slumbered"); + panic!("it happened when we slumbered"); } } diff --git a/src/test/compile-fail/bad-bang-ann.rs b/src/test/compile-fail/bad-bang-ann.rs index 69200ffedf9..7e8142dbb29 100644 --- a/src/test/compile-fail/bad-bang-ann.rs +++ b/src/test/compile-fail/bad-bang-ann.rs @@ -11,7 +11,7 @@ // Tests that a function with a ! annotation always actually fails fn bad_bang(i: uint) -> ! { //~ ERROR computation may converge in a function marked as diverging - if i < 0u { } else { fail!(); } + if i < 0u { } else { panic!(); } } fn main() { bad_bang(5u); } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs index 87904399e03..2a5c7136dc3 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs @@ -20,6 +20,6 @@ fn main() { let x = Some((X { x: () }, X { x: () })); match x { Some((ref _y, _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern - None => fail!() + None => panic!() } } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs index ba011d28925..ae568a5277c 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs @@ -22,6 +22,6 @@ fn main() { let x = some2(X { x: () }, X { x: () }); match x { some2(ref _y, _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern - none2 => fail!() + none2 => panic!() } } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs index 6858b7200db..8c7542fbe6b 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs @@ -20,6 +20,6 @@ fn main() { let x = Some((X { x: () }, X { x: () })); match x { Some((_y, ref _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern - None => fail!() + None => panic!() } } diff --git a/src/test/compile-fail/bind-by-move-no-guards.rs b/src/test/compile-fail/bind-by-move-no-guards.rs index 5602aff5cad..18534db0dd5 100644 --- a/src/test/compile-fail/bind-by-move-no-guards.rs +++ b/src/test/compile-fail/bind-by-move-no-guards.rs @@ -13,8 +13,8 @@ fn main() { let x = Some(rx); tx.send(false); match x { - Some(z) if z.recv() => { fail!() }, //~ ERROR cannot bind by-move into a pattern guard + Some(z) if z.recv() => { panic!() }, //~ ERROR cannot bind by-move into a pattern guard Some(z) => { assert!(!z.recv()); }, - None => fail!() + None => panic!() } } diff --git a/src/test/compile-fail/binop-fail-3.rs b/src/test/compile-fail/binop-fail-3.rs index 2d6f8ccbfa2..097a52b8941 100644 --- a/src/test/compile-fail/binop-fail-3.rs +++ b/src/test/compile-fail/binop-fail-3.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo() -> ! { fail!("quux"); } +fn foo() -> ! { panic!("quux"); } fn main() { foo() //~ ERROR the type of this value must be known in this context == diff --git a/src/test/compile-fail/borrowck-anon-fields-variant.rs b/src/test/compile-fail/borrowck-anon-fields-variant.rs index 12624a49f7a..3e0cd05cba3 100644 --- a/src/test/compile-fail/borrowck-anon-fields-variant.rs +++ b/src/test/compile-fail/borrowck-anon-fields-variant.rs @@ -20,12 +20,12 @@ fn distinct_variant() { let a = match y { Y(ref mut a, _) => a, - X => fail!() + X => panic!() }; let b = match y { Y(_, ref mut b) => b, - X => fail!() + X => panic!() }; *a += 1; @@ -37,12 +37,12 @@ fn same_variant() { let a = match y { Y(ref mut a, _) => a, - X => fail!() + X => panic!() }; let b = match y { Y(ref mut b, _) => b, //~ ERROR cannot borrow - X => fail!() + X => panic!() }; *a += 1; diff --git a/src/test/compile-fail/borrowck-autoref-3261.rs b/src/test/compile-fail/borrowck-autoref-3261.rs index 2a2a3dee1df..4c6088969f3 100644 --- a/src/test/compile-fail/borrowck-autoref-3261.rs +++ b/src/test/compile-fail/borrowck-autoref-3261.rs @@ -28,7 +28,7 @@ fn main() { x = X(Left((0,0))); (*f)() }, - _ => fail!() + _ => panic!() } }) } diff --git a/src/test/compile-fail/borrowck-borrow-from-owned-ptr.rs b/src/test/compile-fail/borrowck-borrow-from-owned-ptr.rs index 208f58f6b54..c071691c947 100644 --- a/src/test/compile-fail/borrowck-borrow-from-owned-ptr.rs +++ b/src/test/compile-fail/borrowck-borrow-from-owned-ptr.rs @@ -19,7 +19,7 @@ struct Bar { int2: int, } -fn make_foo() -> Box<Foo> { fail!() } +fn make_foo() -> Box<Foo> { panic!() } fn borrow_same_field_twice_mut_mut() { let mut foo = make_foo(); diff --git a/src/test/compile-fail/borrowck-borrow-from-stack-variable.rs b/src/test/compile-fail/borrowck-borrow-from-stack-variable.rs index cdcf50c906e..3a85b45ad12 100644 --- a/src/test/compile-fail/borrowck-borrow-from-stack-variable.rs +++ b/src/test/compile-fail/borrowck-borrow-from-stack-variable.rs @@ -18,7 +18,7 @@ struct Bar { int2: int, } -fn make_foo() -> Foo { fail!() } +fn make_foo() -> Foo { panic!() } fn borrow_same_field_twice_mut_mut() { let mut foo = make_foo(); diff --git a/src/test/compile-fail/borrowck-closures-unique.rs b/src/test/compile-fail/borrowck-closures-unique.rs index 61c77ce7bba..febc84ccd44 100644 --- a/src/test/compile-fail/borrowck-closures-unique.rs +++ b/src/test/compile-fail/borrowck-closures-unique.rs @@ -43,7 +43,7 @@ fn d(x: &mut int) { } fn e(x: &mut int) { - let c1: || = || x = fail!(); //~ ERROR closure cannot assign to immutable local variable + let c1: || = || x = panic!(); //~ ERROR closure cannot assign to immutable local variable } fn main() { diff --git a/src/test/compile-fail/borrowck-lend-flow-if.rs b/src/test/compile-fail/borrowck-lend-flow-if.rs index e556b1bc184..8a7ecde700a 100644 --- a/src/test/compile-fail/borrowck-lend-flow-if.rs +++ b/src/test/compile-fail/borrowck-lend-flow-if.rs @@ -17,9 +17,9 @@ fn borrow(_v: &int) {} fn borrow_mut(_v: &mut int) {} -fn cond() -> bool { fail!() } -fn for_func(_f: || -> bool) { fail!() } -fn produce<T>() -> T { fail!(); } +fn cond() -> bool { panic!() } +fn for_func(_f: || -> bool) { panic!() } +fn produce<T>() -> T { panic!(); } fn inc(v: &mut Box<int>) { *v = box() (**v + 1); diff --git a/src/test/compile-fail/borrowck-lend-flow-loop.rs b/src/test/compile-fail/borrowck-lend-flow-loop.rs index 12e1240d10d..6adcfad33f4 100644 --- a/src/test/compile-fail/borrowck-lend-flow-loop.rs +++ b/src/test/compile-fail/borrowck-lend-flow-loop.rs @@ -17,8 +17,8 @@ fn borrow(_v: &int) {} fn borrow_mut(_v: &mut int) {} -fn cond() -> bool { fail!() } -fn produce<T>() -> T { fail!(); } +fn cond() -> bool { panic!() } +fn produce<T>() -> T { panic!(); } fn inc(v: &mut Box<int>) { *v = box() (**v + 1); diff --git a/src/test/compile-fail/borrowck-lend-flow.rs b/src/test/compile-fail/borrowck-lend-flow.rs index 7ad2d904094..de8c7d9def4 100644 --- a/src/test/compile-fail/borrowck-lend-flow.rs +++ b/src/test/compile-fail/borrowck-lend-flow.rs @@ -17,9 +17,9 @@ fn borrow(_v: &int) {} fn borrow_mut(_v: &mut int) {} -fn cond() -> bool { fail!() } -fn for_func(_f: || -> bool) { fail!() } -fn produce<T>() -> T { fail!(); } +fn cond() -> bool { panic!() } +fn for_func(_f: || -> bool) { panic!() } +fn produce<T>() -> T { panic!(); } fn inc(v: &mut Box<int>) { *v = box() (**v + 1); diff --git a/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs b/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs index 30d57d4d755..376832ada4e 100644 --- a/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs +++ b/src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs @@ -16,7 +16,7 @@ enum Either<T, U> { Left(T), Right(U) } *x = Right(1.0); *z } - _ => fail!() + _ => panic!() } } diff --git a/src/test/compile-fail/borrowck-ref-into-rvalue.rs b/src/test/compile-fail/borrowck-ref-into-rvalue.rs index ba1d3a9ddba..726d4bcdf1d 100644 --- a/src/test/compile-fail/borrowck-ref-into-rvalue.rs +++ b/src/test/compile-fail/borrowck-ref-into-rvalue.rs @@ -14,7 +14,7 @@ fn main() { Some(ref m) => { //~ ERROR borrowed value does not live long enough msg = m; }, - None => { fail!() } + None => { panic!() } } println!("{}", *msg); } diff --git a/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs b/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs index d256b033298..4a5418a4f20 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs @@ -15,7 +15,7 @@ fn a<'a>() -> &'a [int] { let vec: &[int] = vec.as_slice(); //~ ERROR does not live long enough let tail = match vec { [_, tail..] => tail, - _ => fail!("a") + _ => panic!("a") }; tail } @@ -25,7 +25,7 @@ fn b<'a>() -> &'a [int] { let vec: &[int] = vec.as_slice(); //~ ERROR does not live long enough let init = match vec { [init.., _] => init, - _ => fail!("b") + _ => panic!("b") }; init } @@ -35,7 +35,7 @@ fn c<'a>() -> &'a [int] { let vec: &[int] = vec.as_slice(); //~ ERROR does not live long enough let slice = match vec { [_, slice.., _] => slice, - _ => fail!("c") + _ => panic!("c") }; slice } diff --git a/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs b/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs index 2c9cf7d1b65..852eb172c59 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs @@ -13,7 +13,7 @@ fn a<'a>() -> &'a int { let vec: &[int] = vec.as_slice(); //~ ERROR `vec` does not live long enough let tail = match vec { [_a, tail..] => &tail[0], - _ => fail!("foo") + _ => panic!("foo") }; tail } diff --git a/src/test/compile-fail/closure-that-fails.rs b/src/test/compile-fail/closure-that-fails.rs index 05317e9c6b0..7a1ebed0a82 100644 --- a/src/test/compile-fail/closure-that-fails.rs +++ b/src/test/compile-fail/closure-that-fails.rs @@ -12,8 +12,8 @@ fn foo(f: || -> !) {} fn main() { // Type inference didn't use to be able to handle this: - foo(|| fail!()); - foo(|| -> ! fail!()); + foo(|| panic!()); + foo(|| -> ! panic!()); foo(|| 22i); //~ ERROR computation may converge in a function marked as diverging foo(|| -> ! 22i); //~ ERROR computation may converge in a function marked as diverging let x = || -> ! 1i; //~ ERROR computation may converge in a function marked as diverging diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-specific-multidispatch.rs b/src/test/compile-fail/coherence-blanket-conflicts-with-specific-multidispatch.rs index 578de06b747..da2e6200eb6 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-specific-multidispatch.rs +++ b/src/test/compile-fail/coherence-blanket-conflicts-with-specific-multidispatch.rs @@ -20,7 +20,7 @@ trait MyTrait<T> { impl<T> MyTrait<T> for T { //~ ERROR E0119 fn get(&self) -> T { - fail!() + panic!() } } diff --git a/src/test/compile-fail/dead-code-closure-bang.rs b/src/test/compile-fail/dead-code-closure-bang.rs index 96e8378a35d..3179b181560 100644 --- a/src/test/compile-fail/dead-code-closure-bang.rs +++ b/src/test/compile-fail/dead-code-closure-bang.rs @@ -11,7 +11,7 @@ #![deny(unreachable_code)] fn main() { - let x: || -> ! = || fail!(); + let x: || -> ! = || panic!(); x(); println!("Foo bar"); //~ ERROR: unreachable statement } diff --git a/src/test/compile-fail/deref-non-pointer.rs b/src/test/compile-fail/deref-non-pointer.rs index 7b1b0f6243a..1c711c0145d 100644 --- a/src/test/compile-fail/deref-non-pointer.rs +++ b/src/test/compile-fail/deref-non-pointer.rs @@ -10,6 +10,6 @@ fn main() { match *1 { //~ ERROR: cannot be dereferenced - _ => { fail!(); } + _ => { panic!(); } } } diff --git a/src/test/compile-fail/fail-no-dead-code-core.rs b/src/test/compile-fail/fail-no-dead-code-core.rs index 58ecdec538e..49a927b9879 100644 --- a/src/test/compile-fail/fail-no-dead-code-core.rs +++ b/src/test/compile-fail/fail-no-dead-code-core.rs @@ -18,11 +18,11 @@ fn foo() { //~ ERROR function is never used // none of these should have any dead_code exposed to the user - fail!(); + panic!(); - fail!("foo"); + panic!("foo"); - fail!("bar {}", "baz") + panic!("bar {}", "baz") } diff --git a/src/test/compile-fail/fail-no-dead-code.rs b/src/test/compile-fail/fail-no-dead-code.rs index 897710609fd..6e5d3a31355 100644 --- a/src/test/compile-fail/fail-no-dead-code.rs +++ b/src/test/compile-fail/fail-no-dead-code.rs @@ -14,11 +14,11 @@ fn foo() { //~ ERROR function is never used // none of these should have any dead_code exposed to the user - fail!(); + panic!(); - fail!("foo"); + panic!("foo"); - fail!("bar {}", "baz") + panic!("bar {}", "baz") } diff --git a/src/test/compile-fail/fail-simple.rs b/src/test/compile-fail/fail-simple.rs index 19c1aa1ba20..97b709592a9 100644 --- a/src/test/compile-fail/fail-simple.rs +++ b/src/test/compile-fail/fail-simple.rs @@ -11,5 +11,5 @@ // error-pattern:unexpected token fn main() { - fail!(@); + panic!(@); } diff --git a/src/test/compile-fail/generic-lifetime-trait-impl.rs b/src/test/compile-fail/generic-lifetime-trait-impl.rs index 8b52324848b..651072d2118 100644 --- a/src/test/compile-fail/generic-lifetime-trait-impl.rs +++ b/src/test/compile-fail/generic-lifetime-trait-impl.rs @@ -23,7 +23,7 @@ trait Foo<'a> { } impl<'a> Foo<'a> for &'a str { - fn bar<T: Bar<'a>>(self) -> &'a str { fail!() } //~ ERROR lifetime + fn bar<T: Bar<'a>>(self) -> &'a str { panic!() } //~ ERROR lifetime } fn main() { diff --git a/src/test/compile-fail/issue-10392-2.rs b/src/test/compile-fail/issue-10392-2.rs index 8d7125d7fdd..2cbb59cc15a 100644 --- a/src/test/compile-fail/issue-10392-2.rs +++ b/src/test/compile-fail/issue-10392-2.rs @@ -10,7 +10,7 @@ struct A { foo: int } -fn a() -> A { fail!() } +fn a() -> A { panic!() } fn main() { let A { .., } = a(); //~ ERROR: expected `}` diff --git a/src/test/compile-fail/issue-10392.rs b/src/test/compile-fail/issue-10392.rs index 455704376d6..4d0e02c6310 100644 --- a/src/test/compile-fail/issue-10392.rs +++ b/src/test/compile-fail/issue-10392.rs @@ -10,7 +10,7 @@ struct A { foo: int } -fn a() -> A { fail!() } +fn a() -> A { panic!() } fn main() { let A { , } = a(); //~ ERROR: expected ident diff --git a/src/test/compile-fail/issue-11844.rs b/src/test/compile-fail/issue-11844.rs index e5400bf60c3..55c12b051b9 100644 --- a/src/test/compile-fail/issue-11844.rs +++ b/src/test/compile-fail/issue-11844.rs @@ -13,7 +13,7 @@ fn main() { match a { Ok(a) => //~ ERROR: mismatched types println!("{}",a), - None => fail!() + None => panic!() } } diff --git a/src/test/compile-fail/issue-12116.rs b/src/test/compile-fail/issue-12116.rs index a80e405d05c..cc0841a6856 100644 --- a/src/test/compile-fail/issue-12116.rs +++ b/src/test/compile-fail/issue-12116.rs @@ -18,7 +18,7 @@ fn tail(source_list: &IntList) -> IntList { &Cons(val, box ref next_list) => tail(next_list), &Cons(val, box Nil) => Cons(val, box Nil), //~^ ERROR: unreachable pattern - _ => fail!() + _ => panic!() } } diff --git a/src/test/compile-fail/issue-12187-1.rs b/src/test/compile-fail/issue-12187-1.rs index 356d95452b3..74423b041dd 100644 --- a/src/test/compile-fail/issue-12187-1.rs +++ b/src/test/compile-fail/issue-12187-1.rs @@ -9,7 +9,7 @@ // except according to those terms. fn new<T>() -> &'static T { - fail!() + panic!() } fn main() { diff --git a/src/test/compile-fail/issue-12187-2.rs b/src/test/compile-fail/issue-12187-2.rs index a67d9dee976..af5c8b45a48 100644 --- a/src/test/compile-fail/issue-12187-2.rs +++ b/src/test/compile-fail/issue-12187-2.rs @@ -9,7 +9,7 @@ // except according to those terms. fn new<'r, T>() -> &'r T { - fail!() + panic!() } fn main() { diff --git a/src/test/compile-fail/issue-13466.rs b/src/test/compile-fail/issue-13466.rs index 14cc0a82df5..e150c1a0f2f 100644 --- a/src/test/compile-fail/issue-13466.rs +++ b/src/test/compile-fail/issue-13466.rs @@ -16,6 +16,6 @@ pub fn main() { // tricked into looking up a non-existing second type parameter. let _x: uint = match Some(1u) { Ok(u) => u, //~ ERROR mismatched types: expected `core::option::Option<uint>` - Err(e) => fail!(e) //~ ERROR mismatched types: expected `core::option::Option<uint>` + Err(e) => panic!(e) //~ ERROR mismatched types: expected `core::option::Option<uint>` }; } diff --git a/src/test/compile-fail/issue-2149.rs b/src/test/compile-fail/issue-2149.rs index 19d210f1905..e64d674b7c8 100644 --- a/src/test/compile-fail/issue-2149.rs +++ b/src/test/compile-fail/issue-2149.rs @@ -15,7 +15,7 @@ trait vec_monad<A> { impl<A> vec_monad<A> for Vec<A> { fn bind<B>(&self, f: |A| -> Vec<B> ) { - let mut r = fail!(); + let mut r = panic!(); for elt in self.iter() { r = r + f(*elt); } //~^ ERROR the type of this value must be known //~^^ ERROR not implemented diff --git a/src/test/compile-fail/issue-2150.rs b/src/test/compile-fail/issue-2150.rs index 7457a1020ce..468fed1eff5 100644 --- a/src/test/compile-fail/issue-2150.rs +++ b/src/test/compile-fail/issue-2150.rs @@ -14,7 +14,7 @@ fn fail_len(v: Vec<int> ) -> uint { let mut i = 3; - fail!(); + panic!(); for x in v.iter() { i += 1u; } //~^ ERROR: unreachable statement return i; diff --git a/src/test/compile-fail/issue-2151.rs b/src/test/compile-fail/issue-2151.rs index 5559ba344ed..fbd8f9163b5 100644 --- a/src/test/compile-fail/issue-2151.rs +++ b/src/test/compile-fail/issue-2151.rs @@ -9,6 +9,6 @@ // except according to those terms. fn main() { - let x = fail!(); + let x = panic!(); x.clone(); //~ ERROR the type of this value must be known in this context } diff --git a/src/test/compile-fail/issue-2330.rs b/src/test/compile-fail/issue-2330.rs index e46dbaf0ae0..6291b024053 100644 --- a/src/test/compile-fail/issue-2330.rs +++ b/src/test/compile-fail/issue-2330.rs @@ -16,7 +16,7 @@ trait channel<T> { // `chan` is not a trait, it's an enum impl chan for int { //~ ERROR `chan` is not a trait - fn send(&self, v: int) { fail!() } + fn send(&self, v: int) { panic!() } } fn main() { diff --git a/src/test/compile-fail/issue-2354.rs b/src/test/compile-fail/issue-2354.rs index a2bb56fdf5f..93f38a50b05 100644 --- a/src/test/compile-fail/issue-2354.rs +++ b/src/test/compile-fail/issue-2354.rs @@ -10,8 +10,8 @@ fn foo() { //~ NOTE Did you mean to close this delimiter? match Some(x) { - Some(y) { fail!(); } - None { fail!(); } + Some(y) { panic!(); } + None { panic!(); } } fn bar() { diff --git a/src/test/compile-fail/issue-2611-4.rs b/src/test/compile-fail/issue-2611-4.rs index 42b70c28be6..70ffa86359d 100644 --- a/src/test/compile-fail/issue-2611-4.rs +++ b/src/test/compile-fail/issue-2611-4.rs @@ -20,7 +20,7 @@ struct E { } impl A for E { - fn b<F: Sync, G>(_x: F) -> F { fail!() } //~ ERROR type parameter 0 requires `Sync` + fn b<F: Sync, G>(_x: F) -> F { panic!() } //~ ERROR type parameter 0 requires `Sync` } fn main() {} diff --git a/src/test/compile-fail/issue-2611-5.rs b/src/test/compile-fail/issue-2611-5.rs index 9b8346da5c5..2eda5d67edd 100644 --- a/src/test/compile-fail/issue-2611-5.rs +++ b/src/test/compile-fail/issue-2611-5.rs @@ -21,7 +21,7 @@ struct E { impl A for E { // n.b. The error message is awful -- see #3404 - fn b<F:Clone,G>(&self, _x: G) -> G { fail!() } //~ ERROR method `b` has an incompatible type + fn b<F:Clone,G>(&self, _x: G) -> G { panic!() } //~ ERROR method `b` has an incompatible type } fn main() {} diff --git a/src/test/compile-fail/issue-3021.rs b/src/test/compile-fail/issue-3021.rs index d44d81b7fe0..578f100eba4 100644 --- a/src/test/compile-fail/issue-3021.rs +++ b/src/test/compile-fail/issue-3021.rs @@ -23,7 +23,7 @@ fn siphash(k0 : u64) -> SipHash { //~^ ERROR unresolved name `k0`. } } - fail!(); + panic!(); } fn main() {} diff --git a/src/test/compile-fail/issue-3601.rs b/src/test/compile-fail/issue-3601.rs index dd27314e14f..2716d49fe69 100644 --- a/src/test/compile-fail/issue-3601.rs +++ b/src/test/compile-fail/issue-3601.rs @@ -38,6 +38,6 @@ fn main() { box Element(ed) => match ed.kind { //~ ERROR non-exhaustive patterns box HTMLImageElement(ref d) if d.image.is_some() => { true } }, - _ => fail!("WAT") //~ ERROR unreachable pattern + _ => panic!("WAT") //~ ERROR unreachable pattern }; } diff --git a/src/test/compile-fail/issue-3668.rs b/src/test/compile-fail/issue-3668.rs index cccf730095b..9c31dc1e38e 100644 --- a/src/test/compile-fail/issue-3668.rs +++ b/src/test/compile-fail/issue-3668.rs @@ -17,7 +17,7 @@ impl PTrait for P { fn getChildOption(&self) -> Option<Box<P>> { static childVal: Box<P> = self.child.get(); //~^ ERROR attempt to use a non-constant value in a constant - fail!(); + panic!(); } } diff --git a/src/test/compile-fail/issue-5500-1.rs b/src/test/compile-fail/issue-5500-1.rs index e1779a1db86..0edcfa8a547 100644 --- a/src/test/compile-fail/issue-5500-1.rs +++ b/src/test/compile-fail/issue-5500-1.rs @@ -16,5 +16,5 @@ fn main() { let a = 5; let _iter = TrieMapIterator{node: &a}; _iter.node = & //~ ERROR cannot assign to immutable field - fail!() + panic!() } diff --git a/src/test/compile-fail/issue-5500.rs b/src/test/compile-fail/issue-5500.rs index e972379944a..86ff29a52b0 100644 --- a/src/test/compile-fail/issue-5500.rs +++ b/src/test/compile-fail/issue-5500.rs @@ -9,6 +9,6 @@ // except according to those terms. fn main() { - &fail!() + &panic!() //~^ ERROR mismatched types: expected `()`, found `&<generic #2>` (expected (), found &-ptr) } diff --git a/src/test/compile-fail/issue-6458-1.rs b/src/test/compile-fail/issue-6458-1.rs index cb3ffae5dba..52a57fa2f44 100644 --- a/src/test/compile-fail/issue-6458-1.rs +++ b/src/test/compile-fail/issue-6458-1.rs @@ -9,5 +9,5 @@ // except according to those terms. fn foo<T>(t: T) {} -fn main() { foo(fail!()) } +fn main() { foo(panic!()) } //~^ ERROR type annotations required diff --git a/src/test/compile-fail/issue-897-2.rs b/src/test/compile-fail/issue-897-2.rs index e6b97b727a7..659b1426bd3 100644 --- a/src/test/compile-fail/issue-897-2.rs +++ b/src/test/compile-fail/issue-897-2.rs @@ -10,7 +10,7 @@ #![deny(unreachable_code)] -fn g() -> ! { fail!(); } +fn g() -> ! { panic!(); } fn f() -> ! { return g(); //~ ERROR `return` in a function declared as diverging g(); diff --git a/src/test/compile-fail/issue-897.rs b/src/test/compile-fail/issue-897.rs index 944546d0b4a..b9cfbd695b0 100644 --- a/src/test/compile-fail/issue-897.rs +++ b/src/test/compile-fail/issue-897.rs @@ -11,8 +11,8 @@ #![deny(unreachable_code)] fn f() -> ! { - return fail!(); //~ ERROR `return` in a function declared as diverging - fail!(); // the unreachable statement error is in <std macro>, at this line, there + return panic!(); //~ ERROR `return` in a function declared as diverging + panic!(); // the unreachable statement error is in <std macro>, at this line, there // only is a note } diff --git a/src/test/compile-fail/lifetime-elision-return-type-requires-explicit-lifetime.rs b/src/test/compile-fail/lifetime-elision-return-type-requires-explicit-lifetime.rs index 5fa8c5db5b0..849f337743b 100644 --- a/src/test/compile-fail/lifetime-elision-return-type-requires-explicit-lifetime.rs +++ b/src/test/compile-fail/lifetime-elision-return-type-requires-explicit-lifetime.rs @@ -11,13 +11,13 @@ // Lifetime annotation needed because we have no arguments. fn f() -> &int { //~ ERROR missing lifetime specifier //~^ NOTE there is no value for it to be borrowed from - fail!() + panic!() } // Lifetime annotation needed because we have two by-reference parameters. fn g(_x: &int, _y: &int) -> &int { //~ ERROR missing lifetime specifier //~^ NOTE the signature does not say whether it is borrowed from `_x` or `_y` - fail!() + panic!() } struct Foo<'a> { @@ -28,7 +28,7 @@ struct Foo<'a> { // and one on the reference. fn h(_x: &Foo) -> &int { //~ ERROR missing lifetime specifier //~^ NOTE the signature does not say which one of `_x`'s 2 elided lifetimes it is borrowed from - fail!() + panic!() } fn main() {} diff --git a/src/test/compile-fail/lint-unused-unsafe.rs b/src/test/compile-fail/lint-unused-unsafe.rs index 8ae3f1fdd0d..df3feefa881 100644 --- a/src/test/compile-fail/lint-unused-unsafe.rs +++ b/src/test/compile-fail/lint-unused-unsafe.rs @@ -20,7 +20,7 @@ mod foo { } } -fn callback<T>(_f: || -> T) -> T { fail!() } +fn callback<T>(_f: || -> T) -> T { panic!() } unsafe fn unsf() {} fn bad1() { unsafe {} } //~ ERROR: unnecessary `unsafe` block @@ -50,7 +50,7 @@ fn good2() { sure that when purity is inherited that the source of the unsafe-ness is tracked correctly */ unsafe { - unsafe fn what() -> Vec<String> { fail!() } + unsafe fn what() -> Vec<String> { panic!() } callback(|| { what(); diff --git a/src/test/compile-fail/lint-visible-private-types.rs b/src/test/compile-fail/lint-visible-private-types.rs index 4a4032d2ab9..55ffdcd7f9f 100644 --- a/src/test/compile-fail/lint-visible-private-types.rs +++ b/src/test/compile-fail/lint-visible-private-types.rs @@ -17,27 +17,27 @@ struct Private<T>; pub struct Public<T>; impl Private<Public<int>> { - pub fn a(&self) -> Private<int> { fail!() } - fn b(&self) -> Private<int> { fail!() } + pub fn a(&self) -> Private<int> { panic!() } + fn b(&self) -> Private<int> { panic!() } - pub fn c() -> Private<int> { fail!() } - fn d() -> Private<int> { fail!() } + pub fn c() -> Private<int> { panic!() } + fn d() -> Private<int> { panic!() } } impl Private<int> { - pub fn e(&self) -> Private<int> { fail!() } - fn f(&self) -> Private<int> { fail!() } + pub fn e(&self) -> Private<int> { panic!() } + fn f(&self) -> Private<int> { panic!() } } impl Public<Private<int>> { - pub fn a(&self) -> Private<int> { fail!() } - fn b(&self) -> Private<int> { fail!() } + pub fn a(&self) -> Private<int> { panic!() } + fn b(&self) -> Private<int> { panic!() } - pub fn c() -> Private<int> { fail!() } //~ ERROR private type in exported type signature - fn d() -> Private<int> { fail!() } + pub fn c() -> Private<int> { panic!() } //~ ERROR private type in exported type signature + fn d() -> Private<int> { panic!() } } impl Public<int> { - pub fn e(&self) -> Private<int> { fail!() } //~ ERROR private type in exported type signature - fn f(&self) -> Private<int> { fail!() } + pub fn e(&self) -> Private<int> { panic!() } //~ ERROR private type in exported type signature + fn f(&self) -> Private<int> { panic!() } } pub fn x(_: Private<int>) {} //~ ERROR private type in exported type signature @@ -70,39 +70,39 @@ enum Qux { } pub trait PubTrait { - fn foo(&self) -> Private<int> { fail!( )} //~ ERROR private type in exported type signature + fn foo(&self) -> Private<int> { panic!( )} //~ ERROR private type in exported type signature fn bar(&self) -> Private<int>; //~ ERROR private type in exported type signature fn baz() -> Private<int>; //~ ERROR private type in exported type signature } impl PubTrait for Public<int> { - fn bar(&self) -> Private<int> { fail!() } - fn baz() -> Private<int> { fail!() } + fn bar(&self) -> Private<int> { panic!() } + fn baz() -> Private<int> { panic!() } } impl PubTrait for Public<Private<int>> { - fn bar(&self) -> Private<int> { fail!() } - fn baz() -> Private<int> { fail!() } + fn bar(&self) -> Private<int> { panic!() } + fn baz() -> Private<int> { panic!() } } impl PubTrait for Private<int> { - fn bar(&self) -> Private<int> { fail!() } - fn baz() -> Private<int> { fail!() } + fn bar(&self) -> Private<int> { panic!() } + fn baz() -> Private<int> { panic!() } } impl PubTrait for (Private<int>,) { - fn bar(&self) -> Private<int> { fail!() } - fn baz() -> Private<int> { fail!() } + fn bar(&self) -> Private<int> { panic!() } + fn baz() -> Private<int> { panic!() } } trait PrivTrait { - fn foo(&self) -> Private<int> { fail!( )} + fn foo(&self) -> Private<int> { panic!( )} fn bar(&self) -> Private<int>; } impl PrivTrait for Private<int> { - fn bar(&self) -> Private<int> { fail!() } + fn bar(&self) -> Private<int> { panic!() } } impl PrivTrait for (Private<int>,) { - fn bar(&self) -> Private<int> { fail!() } + fn bar(&self) -> Private<int> { panic!() } } pub trait ParamTrait<T> { @@ -111,14 +111,14 @@ pub trait ParamTrait<T> { impl ParamTrait<Private<int>> //~ ERROR private type in exported type signature for Public<int> { - fn foo() -> Private<int> { fail!() } + fn foo() -> Private<int> { panic!() } } impl ParamTrait<Private<int>> for Private<int> { - fn foo() -> Private<int> { fail!( )} + fn foo() -> Private<int> { panic!( )} } impl<T: ParamTrait<Private<int>>> //~ ERROR private type in exported type signature ParamTrait<T> for Public<i8> { - fn foo() -> T { fail!() } + fn foo() -> T { panic!() } } diff --git a/src/test/compile-fail/liveness-use-after-send.rs b/src/test/compile-fail/liveness-use-after-send.rs index 54d0b2d00c7..1ad696503e7 100644 --- a/src/test/compile-fail/liveness-use-after-send.rs +++ b/src/test/compile-fail/liveness-use-after-send.rs @@ -11,7 +11,7 @@ fn send<T:Send + std::fmt::Show>(ch: _chan<T>, data: T) { println!("{}", ch); println!("{}", data); - fail!(); + panic!(); } #[deriving(Show)] @@ -24,4 +24,4 @@ fn test00_start(ch: _chan<Box<int>>, message: Box<int>, _count: Box<int>) { println!("{}", message); //~ ERROR use of moved value: `message` } -fn main() { fail!(); } +fn main() { panic!(); } diff --git a/src/test/compile-fail/match-join.rs b/src/test/compile-fail/match-join.rs index de44a005fc3..8064ef0e427 100644 --- a/src/test/compile-fail/match-join.rs +++ b/src/test/compile-fail/match-join.rs @@ -11,10 +11,10 @@ // 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_panic() -> ! { panic!(); } fn main() { - match true { false => { my_fail(); } true => { } } + match true { false => { my_panic(); } true => { } } println!("{}", x); //~ ERROR unresolved name `x`. let x: int; diff --git a/src/test/compile-fail/moves-based-on-type-exprs.rs b/src/test/compile-fail/moves-based-on-type-exprs.rs index 1d6dc504ab4..678808f166c 100644 --- a/src/test/compile-fail/moves-based-on-type-exprs.rs +++ b/src/test/compile-fail/moves-based-on-type-exprs.rs @@ -13,7 +13,7 @@ struct Foo<A> { f: A } -fn guard(_s: String) -> bool {fail!()} +fn guard(_s: String) -> bool {panic!()} fn touch<A>(_a: &A) {} fn f10() { diff --git a/src/test/compile-fail/moves-based-on-type-match-bindings.rs b/src/test/compile-fail/moves-based-on-type-match-bindings.rs index 65ae25396c8..7d209467caf 100644 --- a/src/test/compile-fail/moves-based-on-type-match-bindings.rs +++ b/src/test/compile-fail/moves-based-on-type-match-bindings.rs @@ -13,7 +13,7 @@ // terms of the binding, not the discriminant. struct Foo<A> { f: A } -fn guard(_s: String) -> bool {fail!()} +fn guard(_s: String) -> bool {panic!()} fn touch<A>(_a: &A) {} fn f10() { diff --git a/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs b/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs index ff5ad2c5e19..2a73b769895 100644 --- a/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs +++ b/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs @@ -31,7 +31,7 @@ fn innocent_looking_victim() { //~^ ERROR: cannot borrow `*f` as mutable because println!("{}", msg); }, - None => fail!("oops"), + None => panic!("oops"), } } }) diff --git a/src/test/compile-fail/non-exhaustive-match-nested.rs b/src/test/compile-fail/non-exhaustive-match-nested.rs index 439c82a6df0..eb946a90c37 100644 --- a/src/test/compile-fail/non-exhaustive-match-nested.rs +++ b/src/test/compile-fail/non-exhaustive-match-nested.rs @@ -23,7 +23,7 @@ fn match_nested_vecs<'a, T>(l1: Option<&'a [T]>, l2: Result<&'a [T], ()>) -> &'s fn main() { let x = a(c); match x { //~ ERROR non-exhaustive patterns: `a(c)` not covered - a(d) => { fail!("hello"); } - b => { fail!("goodbye"); } + a(d) => { panic!("hello"); } + b => { panic!("goodbye"); } } } diff --git a/src/test/compile-fail/not-enough-arguments.rs b/src/test/compile-fail/not-enough-arguments.rs index 57eca3666ef..2deb9591a83 100644 --- a/src/test/compile-fail/not-enough-arguments.rs +++ b/src/test/compile-fail/not-enough-arguments.rs @@ -13,7 +13,7 @@ // unrelated errors. fn foo(a: int, b: int, c: int, d:int) { - fail!(); + panic!(); } fn main() { diff --git a/src/test/compile-fail/pattern-tyvar-2.rs b/src/test/compile-fail/pattern-tyvar-2.rs index 38669a99b49..7da62ef4db7 100644 --- a/src/test/compile-fail/pattern-tyvar-2.rs +++ b/src/test/compile-fail/pattern-tyvar-2.rs @@ -11,7 +11,7 @@ enum bar { t1((), Option<Vec<int>>), t2, } // n.b. my change changes this error message, but I think it's right -- tjc -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; } _ => { panic!(); } } } //~^ ERROR binary operation `*` cannot be applied to fn main() { } diff --git a/src/test/compile-fail/pattern-tyvar.rs b/src/test/compile-fail/pattern-tyvar.rs index efb98a74538..7752ea521f7 100644 --- a/src/test/compile-fail/pattern-tyvar.rs +++ b/src/test/compile-fail/pattern-tyvar.rs @@ -17,7 +17,7 @@ fn foo(t: bar) { t1(_, Some::<int>(x)) => { println!("{}", x); } - _ => { fail!(); } + _ => { panic!(); } } } diff --git a/src/test/compile-fail/qquote-1.rs b/src/test/compile-fail/qquote-1.rs index 06d473baea8..deae9a83866 100644 --- a/src/test/compile-fail/qquote-1.rs +++ b/src/test/compile-fail/qquote-1.rs @@ -64,5 +64,5 @@ fn main() { } fn check_pp<T>(expr: T, f: |pprust::ps, T|, expect: str) { - fail!(); + panic!(); } diff --git a/src/test/compile-fail/qquote-2.rs b/src/test/compile-fail/qquote-2.rs index f63dd91eb2b..94485dddd13 100644 --- a/src/test/compile-fail/qquote-2.rs +++ b/src/test/compile-fail/qquote-2.rs @@ -57,5 +57,5 @@ fn main() { } fn check_pp<T>(expr: T, f: |pprust::ps, T|, expect: str) { - fail!(); + panic!(); } diff --git a/src/test/compile-fail/regions-fn-bound.rs b/src/test/compile-fail/regions-fn-bound.rs index b3b5993bf91..c2b52b79f6c 100644 --- a/src/test/compile-fail/regions-fn-bound.rs +++ b/src/test/compile-fail/regions-fn-bound.rs @@ -21,8 +21,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn of<T>() -> |T| { fail!(); } -fn subtype<T>(x: |T|) { fail!(); } +fn of<T>() -> |T| { panic!(); } +fn subtype<T>(x: |T|) { panic!(); } fn test_fn<'x, 'y, 'z, T>(_x: &'x T, _y: &'y T, _z: &'z T) { // Here, x, y, and z are free. Other letters diff --git a/src/test/compile-fail/regions-fn-subtyping-return-static.rs b/src/test/compile-fail/regions-fn-subtyping-return-static.rs index 2d20634cdc4..72004f8714c 100644 --- a/src/test/compile-fail/regions-fn-subtyping-return-static.rs +++ b/src/test/compile-fail/regions-fn-subtyping-return-static.rs @@ -31,17 +31,17 @@ fn want_G(f: G) { } // Should meet both. fn foo(x: &S) -> &'static S { - fail!() + panic!() } // Should meet both. fn bar<'a,'b>(x: &'a S) -> &'b S { - fail!() + panic!() } // Meets F, but not G. fn baz(x: &S) -> &S { - fail!() + panic!() } fn supply_F() { diff --git a/src/test/compile-fail/regions-fn-subtyping.rs b/src/test/compile-fail/regions-fn-subtyping.rs index 30b33e82a4b..8e8d892a39f 100644 --- a/src/test/compile-fail/regions-fn-subtyping.rs +++ b/src/test/compile-fail/regions-fn-subtyping.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn of<'a,T>() -> |T|:'a { fail!(); } -fn subtype<T>(x: |T|) { fail!(); } +fn of<'a,T>() -> |T|:'a { panic!(); } +fn subtype<T>(x: |T|) { panic!(); } fn test_fn<'x,'y,'z,T>(_x: &'x T, _y: &'y T, _z: &'z T) { // Here, x, y, and z are free. Other letters diff --git a/src/test/compile-fail/regions-free-region-ordering-callee.rs b/src/test/compile-fail/regions-free-region-ordering-callee.rs index 26cf3be429b..435d10a0a29 100644 --- a/src/test/compile-fail/regions-free-region-ordering-callee.rs +++ b/src/test/compile-fail/regions-free-region-ordering-callee.rs @@ -27,7 +27,7 @@ fn ordering3<'a, 'b>(x: &'a uint, y: &'b uint) -> &'a &'b uint { // Do not infer an ordering from the return value. let z: &'b uint = &*x; //~^ ERROR cannot infer - fail!(); + panic!(); } fn ordering4<'a, 'b>(a: &'a uint, b: &'b uint, x: |&'a &'b uint|) { diff --git a/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs b/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs index 9615e32bb1a..a9df449032e 100644 --- a/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs +++ b/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs @@ -15,7 +15,7 @@ use std::vec::Vec; fn last<T>(v: Vec<&T> ) -> std::option::Option<T> { - fail!(); + panic!(); } fn main() { diff --git a/src/test/compile-fail/tag-type-args.rs b/src/test/compile-fail/tag-type-args.rs index f2ef1d19525..5785a13b006 100644 --- a/src/test/compile-fail/tag-type-args.rs +++ b/src/test/compile-fail/tag-type-args.rs @@ -14,4 +14,4 @@ enum quux<T> { bar } fn foo(c: quux) { assert!((false)); } -fn main() { fail!(); } +fn main() { panic!(); } diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums-locals.rs b/src/test/compile-fail/trait-bounds-on-structs-and-enums-locals.rs index 4233fa843eb..52035c09dd6 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums-locals.rs +++ b/src/test/compile-fail/trait-bounds-on-structs-and-enums-locals.rs @@ -20,7 +20,7 @@ fn main() { x: 3i }; - let baz: Foo<uint> = fail!(); + let baz: Foo<uint> = panic!(); //~^ ERROR not implemented } diff --git a/src/test/compile-fail/unused-result.rs b/src/test/compile-fail/unused-result.rs index ecc52c0ee7d..124bd9c4d5b 100644 --- a/src/test/compile-fail/unused-result.rs +++ b/src/test/compile-fail/unused-result.rs @@ -17,7 +17,7 @@ enum MustUse { Test } #[must_use = "some message"] enum MustUseMsg { Test2 } -fn foo<T>() -> T { fail!() } +fn foo<T>() -> T { panic!() } fn bar() -> int { return foo::<int>(); } fn baz() -> MustUse { return foo::<MustUse>(); } diff --git a/src/test/compile-fail/weak-lang-item.rs b/src/test/compile-fail/weak-lang-item.rs index 74ec56f7bd9..baac192cbf0 100644 --- a/src/test/compile-fail/weak-lang-item.rs +++ b/src/test/compile-fail/weak-lang-item.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:weak-lang-items.rs -// error-pattern: language item required, but not found: `fail_fmt` +// error-pattern: language item required, but not found: `panic_fmt` // error-pattern: language item required, but not found: `stack_exhausted` // error-pattern: language item required, but not found: `eh_personality` diff --git a/src/test/debuginfo/basic-types-metadata.rs b/src/test/debuginfo/basic-types-metadata.rs index d67a6b1e200..dae1aca4ed3 100644 --- a/src/test/debuginfo/basic-types-metadata.rs +++ b/src/test/debuginfo/basic-types-metadata.rs @@ -72,4 +72,4 @@ fn main() { } fn _zzz() {()} -fn _yyy() -> ! {fail!()} +fn _yyy() -> ! {panic!()} diff --git a/src/test/pretty/issue-929.rs b/src/test/pretty/issue-929.rs index 85b71e4e86c..377f4669ffc 100644 --- a/src/test/pretty/issue-929.rs +++ b/src/test/pretty/issue-929.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn f() { if (1i == fail!()) { } else { } } +fn f() { if (1i == panic!()) { } else { } } fn main() { } diff --git a/src/test/run-fail/args-fail.rs b/src/test/run-fail/args-fail.rs index 5e1b7bb69bb..4878ec59fd4 100644 --- a/src/test/run-fail/args-fail.rs +++ b/src/test/run-fail/args-fail.rs @@ -11,6 +11,6 @@ // error-pattern:meep -fn f(_a: int, _b: int, _c: Box<int>) { fail!("moop"); } +fn f(_a: int, _b: int, _c: Box<int>) { panic!("moop"); } -fn main() { f(1, fail!("meep"), box 42); } +fn main() { f(1, panic!("meep"), box 42); } diff --git a/src/test/run-fail/assert-macro-explicit.rs b/src/test/run-fail/assert-macro-explicit.rs index 8e70c2c3561..197ed59c07f 100644 --- a/src/test/run-fail/assert-macro-explicit.rs +++ b/src/test/run-fail/assert-macro-explicit.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:failed at 'assertion failed: false' +// error-pattern:panicked at 'assertion failed: false' fn main() { assert!(false); diff --git a/src/test/run-fail/assert-macro-fmt.rs b/src/test/run-fail/assert-macro-fmt.rs index 72222ce4362..223c60d6ae4 100644 --- a/src/test/run-fail/assert-macro-fmt.rs +++ b/src/test/run-fail/assert-macro-fmt.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:failed at 'test-assert-fmt 42 rust' +// error-pattern:panicked at 'test-assert-fmt 42 rust' fn main() { assert!(false, "test-assert-fmt {} {}", 42i, "rust"); diff --git a/src/test/run-fail/assert-macro-owned.rs b/src/test/run-fail/assert-macro-owned.rs index a1a8eb6a092..e68aef10de8 100644 --- a/src/test/run-fail/assert-macro-owned.rs +++ b/src/test/run-fail/assert-macro-owned.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:failed at 'test-assert-owned' +// error-pattern:panicked at 'test-assert-owned' fn main() { assert!(false, "test-assert-owned".to_string()); diff --git a/src/test/run-fail/assert-macro-static.rs b/src/test/run-fail/assert-macro-static.rs index a35258462de..59be468e0cb 100644 --- a/src/test/run-fail/assert-macro-static.rs +++ b/src/test/run-fail/assert-macro-static.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:failed at 'test-assert-static' +// error-pattern:panicked at 'test-assert-static' fn main() { assert!(false, "test-assert-static"); diff --git a/src/test/run-fail/binop-fail.rs b/src/test/run-fail/binop-fail.rs index 1ae520bbf1a..ac85b218ec0 100644 --- a/src/test/run-fail/binop-fail.rs +++ b/src/test/run-fail/binop-fail.rs @@ -9,5 +9,5 @@ // except according to those terms. // error-pattern:quux -fn my_err(s: String) -> ! { println!("{}", s); fail!("quux"); } +fn my_err(s: String) -> ! { println!("{}", s); panic!("quux"); } fn main() { 3u == my_err("bye".to_string()); } diff --git a/src/test/run-fail/bug-2470-bounds-check-overflow-2.rs b/src/test/run-fail/bug-2470-bounds-check-overflow-2.rs index 8ca317e1dd7..06712841823 100644 --- a/src/test/run-fail/bug-2470-bounds-check-overflow-2.rs +++ b/src/test/run-fail/bug-2470-bounds-check-overflow-2.rs @@ -16,7 +16,7 @@ use std::uint; fn main() { let x = vec!(1u,2u,3u); - // This should cause a bounds-check failure, but may not if we do our + // This should cause a bounds-check panic, but may not if we do our // bounds checking by comparing a scaled index value to the vector's // length (in bytes), because the scaling of the index will cause it to // wrap around to a small number. @@ -24,6 +24,6 @@ fn main() { let idx = uint::MAX & !(uint::MAX >> 1u); println!("ov2 idx = 0x%x", idx); - // This should fail. + // This should panic. println!("ov2 0x%x", x[idx]); } diff --git a/src/test/run-fail/bug-2470-bounds-check-overflow-3.rs b/src/test/run-fail/bug-2470-bounds-check-overflow-3.rs index 6106abc76c3..22a9fffb2fb 100644 --- a/src/test/run-fail/bug-2470-bounds-check-overflow-3.rs +++ b/src/test/run-fail/bug-2470-bounds-check-overflow-3.rs @@ -17,7 +17,7 @@ use std::u64; fn main() { let x = vec!(1u,2u,3u); - // This should cause a bounds-check failure, but may not if we do our + // This should cause a bounds-check panic, but may not if we do our // bounds checking by truncating the index value to the size of the // machine word, losing relevant bits of the index value. @@ -28,13 +28,13 @@ fn main() { (idx >> 32) as uint, idx as uint); - // This should fail. + // This should panic. println!("ov3 0x%x", x.as_slice()[idx]); } #[cfg(target_arch="x86_64")] fn main() { - // This version just fails anyways, for symmetry on 64-bit hosts. + // This version just panics anyways, for symmetry on 64-bit hosts. let x = vec!(1u,2u,3u); error!("ov3 0x%x", x.as_slice()[200]); } diff --git a/src/test/run-fail/bug-2470-bounds-check-overflow.rs b/src/test/run-fail/bug-2470-bounds-check-overflow.rs index 9123342f09a..f8686d0dbb5 100644 --- a/src/test/run-fail/bug-2470-bounds-check-overflow.rs +++ b/src/test/run-fail/bug-2470-bounds-check-overflow.rs @@ -14,7 +14,7 @@ use std::mem; fn main() { - // This should cause a bounds-check failure, but may not if we do our + // This should cause a bounds-check panic, but may not if we do our // bounds checking by comparing the scaled index to the vector's // address-bounds, since we've scaled the index to wrap around to the // address of the 0th cell in the array (even though the index is @@ -30,6 +30,6 @@ fn main() { println!("ov1 idx * sizeof::<uint>() = 0x{:x}", idx * mem::size_of::<uint>()); - // This should fail. + // This should panic. println!("ov1 0x{:x}", x[idx]); } diff --git a/src/test/run-fail/bug-811.rs b/src/test/run-fail/bug-811.rs index 2a256b9a4e3..e46564f8076 100644 --- a/src/test/run-fail/bug-811.rs +++ b/src/test/run-fail/bug-811.rs @@ -19,6 +19,6 @@ struct chan_t<T> { port: port_id, } -fn send<T:Send>(_ch: chan_t<T>, _data: T) { fail!(); } +fn send<T:Send>(_ch: chan_t<T>, _data: T) { panic!(); } -fn main() { fail!("quux"); } +fn main() { panic!("quux"); } diff --git a/src/test/run-fail/by-value-self-objects-fail.rs b/src/test/run-fail/by-value-self-objects-fail.rs index 74889263cc8..6b000866d3a 100644 --- a/src/test/run-fail/by-value-self-objects-fail.rs +++ b/src/test/run-fail/by-value-self-objects-fail.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:explicit failure +// error-pattern:explicit panic trait Foo { fn foo(self, x: int); @@ -23,7 +23,7 @@ struct S { impl Foo for S { fn foo(self, x: int) { - fail!() + panic!() } } diff --git a/src/test/run-fail/die-macro-expr.rs b/src/test/run-fail/die-macro-expr.rs index 7f7eddd86cf..2014a108b3d 100644 --- a/src/test/run-fail/die-macro-expr.rs +++ b/src/test/run-fail/die-macro-expr.rs @@ -11,5 +11,5 @@ // error-pattern:test fn main() { - let _i: int = fail!("test"); + let _i: int = panic!("test"); } diff --git a/src/test/run-fail/die-macro-pure.rs b/src/test/run-fail/die-macro-pure.rs index f1d9b15c42a..b54bf1c0c68 100644 --- a/src/test/run-fail/die-macro-pure.rs +++ b/src/test/run-fail/die-macro-pure.rs @@ -11,7 +11,7 @@ // error-pattern:test fn f() { - fail!("test"); + panic!("test"); } fn main() { diff --git a/src/test/run-fail/die-macro.rs b/src/test/run-fail/die-macro.rs index 82e790c5d9f..811bd6e037d 100644 --- a/src/test/run-fail/die-macro.rs +++ b/src/test/run-fail/die-macro.rs @@ -11,5 +11,5 @@ // error-pattern:test fn main() { - fail!("test"); + panic!("test"); } diff --git a/src/test/run-fail/doublefail.rs b/src/test/run-fail/doublefail.rs index 4f3dfaa80b9..3835a16a5c2 100644 --- a/src/test/run-fail/doublefail.rs +++ b/src/test/run-fail/doublefail.rs @@ -12,6 +12,6 @@ //error-pattern:One fn main() { - fail!("One"); - fail!("Two"); + panic!("One"); + panic!("Two"); } diff --git a/src/test/run-fail/explicit-fail-msg.rs b/src/test/run-fail/explicit-fail-msg.rs index 4af9b82ec7e..f6d27cf9959 100644 --- a/src/test/run-fail/explicit-fail-msg.rs +++ b/src/test/run-fail/explicit-fail-msg.rs @@ -15,5 +15,5 @@ fn main() { let mut a = 1i; if 1i == 1 { a = 2; } - fail!(format!("woooo{}", "o")); + panic!(format!("woooo{}", "o")); } diff --git a/src/test/run-fail/explicit-fail.rs b/src/test/run-fail/explicit-fail.rs index 8c204b66e36..4699897bf8a 100644 --- a/src/test/run-fail/explicit-fail.rs +++ b/src/test/run-fail/explicit-fail.rs @@ -12,4 +12,4 @@ // error-pattern:explicit -fn main() { fail!(); } +fn main() { panic!(); } diff --git a/src/test/run-fail/expr-fn-fail.rs b/src/test/run-fail/expr-fn-fail.rs index e645ea34df5..8cf018fb770 100644 --- a/src/test/run-fail/expr-fn-fail.rs +++ b/src/test/run-fail/expr-fn-fail.rs @@ -8,10 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// error-pattern:explicit panic - - -// error-pattern:explicit failure -fn f() -> ! { fail!() } +fn f() -> ! { panic!() } fn main() { f(); } diff --git a/src/test/run-fail/expr-if-fail-fn.rs b/src/test/run-fail/expr-if-fail-fn.rs index 99f798147f2..987bee55c60 100644 --- a/src/test/run-fail/expr-if-fail-fn.rs +++ b/src/test/run-fail/expr-if-fail-fn.rs @@ -8,11 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// error-pattern:explicit panic - - -// error-pattern:explicit failure -fn f() -> ! { fail!() } +fn f() -> ! { panic!() } fn g() -> int { let x = if true { f() } else { 10 }; return x; } diff --git a/src/test/run-fail/expr-if-fail.rs b/src/test/run-fail/expr-if-fail.rs index 55d86bc6493..f04c94a3bf4 100644 --- a/src/test/run-fail/expr-if-fail.rs +++ b/src/test/run-fail/expr-if-fail.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// error-pattern:explicit panic - - -// error-pattern:explicit failure -fn main() { let _x = if false { 0i } else if true { fail!() } else { 10i }; } +fn main() { let _x = if false { 0i } else if true { panic!() } else { 10i }; } diff --git a/src/test/run-fail/expr-match-fail-fn.rs b/src/test/run-fail/expr-match-fail-fn.rs index 6476e57a35b..069c1d5ed35 100644 --- a/src/test/run-fail/expr-match-fail-fn.rs +++ b/src/test/run-fail/expr-match-fail-fn.rs @@ -8,11 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// error-pattern:explicit panic - - -// error-pattern:explicit failure -fn f() -> ! { fail!() } +fn f() -> ! { panic!() } fn g() -> int { let x = match true { true => { f() } false => { 10 } }; return x; } diff --git a/src/test/run-fail/expr-match-fail.rs b/src/test/run-fail/expr-match-fail.rs index d15ec3f7b48..d5c005b7029 100644 --- a/src/test/run-fail/expr-match-fail.rs +++ b/src/test/run-fail/expr-match-fail.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// error-pattern:explicit panic - - -// error-pattern:explicit failure -fn main() { let _x = match true { false => { 0i } true => { fail!() } }; } +fn main() { let _x = match true { false => { 0i } true => { panic!() } }; } diff --git a/src/test/run-fail/extern-fail.rs b/src/test/run-fail/extern-fail.rs index c11d269a897..21a332a46cb 100644 --- a/src/test/run-fail/extern-fail.rs +++ b/src/test/run-fail/extern-fail.rs @@ -45,7 +45,7 @@ fn main() { task::spawn(proc() { let result = count(5u); println!("result = %?", result); - fail!(); + panic!(); }); } } diff --git a/src/test/run-fail/fail-arg.rs b/src/test/run-fail/fail-arg.rs index e23145ec253..4d4f9317510 100644 --- a/src/test/run-fail/fail-arg.rs +++ b/src/test/run-fail/fail-arg.rs @@ -11,4 +11,4 @@ // error-pattern:woe fn f(a: int) { println!("{}", a); } -fn main() { f(fail!("woe")); } +fn main() { f(panic!("woe")); } diff --git a/src/test/run-fail/fail-macro-any-wrapped.rs b/src/test/run-fail/fail-macro-any-wrapped.rs index e1eea1d89b9..e25390a7986 100644 --- a/src/test/run-fail/fail-macro-any-wrapped.rs +++ b/src/test/run-fail/fail-macro-any-wrapped.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:failed at 'Box<Any>' +// error-pattern:panicked at 'Box<Any>' fn main() { - fail!(box 612_i64); + panic!(box 612_i64); } diff --git a/src/test/run-fail/fail-macro-any.rs b/src/test/run-fail/fail-macro-any.rs index 528f18dde0d..b73c66c4f21 100644 --- a/src/test/run-fail/fail-macro-any.rs +++ b/src/test/run-fail/fail-macro-any.rs @@ -8,9 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:failed at 'Box<Any>' - +// error-pattern:panicked at 'Box<Any>' fn main() { - fail!(box 413i as Box<::std::any::Any+Send>); + panic!(box 413i as Box<::std::any::Any+Send>); } diff --git a/src/test/run-fail/fail-macro-explicit.rs b/src/test/run-fail/fail-macro-explicit.rs index 13e3a6a31a8..a8565549a03 100644 --- a/src/test/run-fail/fail-macro-explicit.rs +++ b/src/test/run-fail/fail-macro-explicit.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:failed at 'explicit failure' +// error-pattern:panicked at 'explicit panic' fn main() { - fail!(); + panic!(); } diff --git a/src/test/run-fail/fail-macro-fmt.rs b/src/test/run-fail/fail-macro-fmt.rs index b3984c210b5..ac50f02cf33 100644 --- a/src/test/run-fail/fail-macro-fmt.rs +++ b/src/test/run-fail/fail-macro-fmt.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:failed at 'test-fail-fmt 42 rust' +// error-pattern:panicked at 'test-fail-fmt 42 rust' fn main() { - fail!("test-fail-fmt {} {}", 42i, "rust"); + panic!("test-fail-fmt {} {}", 42i, "rust"); } diff --git a/src/test/run-fail/fail-macro-owned.rs b/src/test/run-fail/fail-macro-owned.rs index e59f5bdcaa1..2f695c4e4b7 100644 --- a/src/test/run-fail/fail-macro-owned.rs +++ b/src/test/run-fail/fail-macro-owned.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:failed at 'test-fail-owned' +// error-pattern:panicked at 'test-fail-owned' fn main() { - fail!("test-fail-owned"); + panic!("test-fail-owned"); } diff --git a/src/test/run-fail/fail-macro-static.rs b/src/test/run-fail/fail-macro-static.rs index 688ca4ce7e5..c62162da09b 100644 --- a/src/test/run-fail/fail-macro-static.rs +++ b/src/test/run-fail/fail-macro-static.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:failed at 'test-fail-static' +// error-pattern:panicked at 'test-fail-static' fn main() { - fail!("test-fail-static"); + panic!("test-fail-static"); } diff --git a/src/test/run-fail/fail-main.rs b/src/test/run-fail/fail-main.rs index f90530a4435..877ea9cd0a4 100644 --- a/src/test/run-fail/fail-main.rs +++ b/src/test/run-fail/fail-main.rs @@ -9,4 +9,4 @@ // except according to those terms. // error-pattern:moop -fn main() { fail!("moop"); } +fn main() { panic!("moop"); } diff --git a/src/test/run-fail/fail-non-utf8.rs b/src/test/run-fail/fail-non-utf8.rs index 88720b421e6..8b013199369 100644 --- a/src/test/run-fail/fail-non-utf8.rs +++ b/src/test/run-fail/fail-non-utf8.rs @@ -12,7 +12,7 @@ // Previously failed formating invalid utf8. // cc #16877 -// error-pattern:failed at 'hello�' +// error-pattern:panicked at 'hello�' struct Foo; impl std::fmt::Show for Foo { @@ -22,5 +22,5 @@ impl std::fmt::Show for Foo { } } fn main() { - fail!("{}", Foo) + panic!("{}", Foo) } diff --git a/src/test/run-fail/fail-parens.rs b/src/test/run-fail/fail-parens.rs index 90a44e42759..06655e4c681 100644 --- a/src/test/run-fail/fail-parens.rs +++ b/src/test/run-fail/fail-parens.rs @@ -12,12 +12,12 @@ // certain positions // error-pattern:oops -fn bigfail() { - while (fail!("oops")) { if (fail!()) { - match (fail!()) { () => { +fn bigpanic() { + while (panic!("oops")) { if (panic!()) { + match (panic!()) { () => { } } }}; } -fn main() { bigfail(); } +fn main() { bigpanic(); } diff --git a/src/test/run-fail/fail-task-name-none.rs b/src/test/run-fail/fail-task-name-none.rs index 75d23d0f4fd..3f8abc41ff7 100644 --- a/src/test/run-fail/fail-task-name-none.rs +++ b/src/test/run-fail/fail-task-name-none.rs @@ -8,13 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:task '<unnamed>' failed at 'test' +// error-pattern:task '<unnamed>' panicked at 'test' use std::task; fn main() { let r: Result<int,_> = task::try(proc() { - fail!("test"); + panic!("test"); 1i }); assert!(r.is_ok()); diff --git a/src/test/run-fail/fail-task-name-owned.rs b/src/test/run-fail/fail-task-name-owned.rs index edb03b2d6b4..0a303475a29 100644 --- a/src/test/run-fail/fail-task-name-owned.rs +++ b/src/test/run-fail/fail-task-name-owned.rs @@ -8,14 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:task 'owned name' failed at 'test' +// error-pattern:task 'owned name' panicked at 'test' use std::task::TaskBuilder; fn main() { let r: Result<int,_> = TaskBuilder::new().named("owned name".to_string()) .try(proc() { - fail!("test"); + panic!("test"); 1i }); assert!(r.is_ok()); diff --git a/src/test/run-fail/fail-task-name-send-str.rs b/src/test/run-fail/fail-task-name-send-str.rs index 0a740099778..73fca246590 100644 --- a/src/test/run-fail/fail-task-name-send-str.rs +++ b/src/test/run-fail/fail-task-name-send-str.rs @@ -8,13 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:task 'send name' failed at 'test' +// error-pattern:task 'send name' panicked at 'test' fn main() { let r: Result<int,_> = ::std::task::TaskBuilder::new().named("send name".into_maybe_owned()) .try(proc() { - fail!("test"); + panic!("test"); 3i }); assert!(r.is_ok()); diff --git a/src/test/run-fail/fail-task-name-static.rs b/src/test/run-fail/fail-task-name-static.rs index 0b2901889cb..21c019e1a74 100644 --- a/src/test/run-fail/fail-task-name-static.rs +++ b/src/test/run-fail/fail-task-name-static.rs @@ -8,12 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:task 'static name' failed at 'test' +// error-pattern:task 'static name' panicked at 'test' fn main() { let r: Result<int,_> = ::std::task::TaskBuilder::new().named("static name").try(proc() { - fail!("test"); + panic!("test"); }); assert!(r.is_ok()); } diff --git a/src/test/run-fail/fmt-fail.rs b/src/test/run-fail/fmt-fail.rs index ae89f951840..22e81480867 100644 --- a/src/test/run-fail/fmt-fail.rs +++ b/src/test/run-fail/fmt-fail.rs @@ -12,5 +12,5 @@ fn main() { let str_var: String = "meh".to_string(); - fail!("{}", str_var); + panic!("{}", str_var); } diff --git a/src/test/run-fail/for-each-loop-fail.rs b/src/test/run-fail/for-each-loop-fail.rs index 508463599a3..472c8ae15b9 100644 --- a/src/test/run-fail/for-each-loop-fail.rs +++ b/src/test/run-fail/for-each-loop-fail.rs @@ -10,4 +10,4 @@ // error-pattern:moop -fn main() { for _ in range(0u, 10u) { fail!("moop"); } } +fn main() { for _ in range(0u, 10u) { panic!("moop"); } } diff --git a/src/test/run-fail/glob-use-std.rs b/src/test/run-fail/glob-use-std.rs index bf04789bbc7..939845a7b34 100644 --- a/src/test/run-fail/glob-use-std.rs +++ b/src/test/run-fail/glob-use-std.rs @@ -14,11 +14,11 @@ // // Expanded pretty printing causes resolve conflicts. -// error-pattern:fail works +// error-pattern:panic works #![feature(globs)] use std::*; fn main() { - fail!("fail works") + panic!("panic works") } diff --git a/src/test/run-fail/if-check-fail.rs b/src/test/run-fail/if-check-fail.rs index b5f39e73fcb..1ead81b0091 100644 --- a/src/test/run-fail/if-check-fail.rs +++ b/src/test/run-fail/if-check-fail.rs @@ -19,7 +19,7 @@ fn foo(x: uint) { if even(x) { println!("{}", x); } else { - fail!("Number is odd"); + panic!("Number is odd"); } } diff --git a/src/test/run-fail/if-cond-bot.rs b/src/test/run-fail/if-cond-bot.rs index d80ae967f0e..f38b00ab46d 100644 --- a/src/test/run-fail/if-cond-bot.rs +++ b/src/test/run-fail/if-cond-bot.rs @@ -9,5 +9,5 @@ // except according to those terms. // error-pattern:quux -fn my_err(s: String) -> ! { println!("{}", s); fail!("quux"); } +fn my_err(s: String) -> ! { println!("{}", s); panic!("quux"); } fn main() { if my_err("bye".to_string()) { } } diff --git a/src/test/run-fail/issue-12920.rs b/src/test/run-fail/issue-12920.rs index b5b8d4855ab..8dbfc06152a 100644 --- a/src/test/run-fail/issue-12920.rs +++ b/src/test/run-fail/issue-12920.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:explicit failure +// error-pattern:explicit panic pub fn main() { - fail!(); println!("{}", 1i); + panic!(); println!("{}", 1i); } diff --git a/src/test/run-fail/issue-13202.rs b/src/test/run-fail/issue-13202.rs index 80006936f22..57b7dfc1eec 100644 --- a/src/test/run-fail/issue-13202.rs +++ b/src/test/run-fail/issue-13202.rs @@ -11,5 +11,5 @@ // error-pattern:bad input fn main() { - Some("foo").unwrap_or(fail!("bad input")).to_string(); + Some("foo").unwrap_or(panic!("bad input")).to_string(); } diff --git a/src/test/run-fail/issue-2444.rs b/src/test/run-fail/issue-2444.rs index 9a5a8e7c38f..2b20540501e 100644 --- a/src/test/run-fail/issue-2444.rs +++ b/src/test/run-fail/issue-2444.rs @@ -8,13 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:explicit failure +// error-pattern:explicit panic use std::sync::Arc; enum e<T> { ee(Arc<T>) } -fn foo() -> e<int> {fail!();} +fn foo() -> e<int> {panic!();} fn main() { let _f = foo(); diff --git a/src/test/run-fail/issue-3029.rs b/src/test/run-fail/issue-3029.rs index 539d2adc7d4..686277c8c09 100644 --- a/src/test/run-fail/issue-3029.rs +++ b/src/test/run-fail/issue-3029.rs @@ -17,6 +17,6 @@ fn main() { let mut x = Vec::new(); let y = vec!(3i); - fail!("so long"); + panic!("so long"); x.extend(y.into_iter()); } diff --git a/src/test/run-fail/issue-948.rs b/src/test/run-fail/issue-948.rs index 5669131aeee..878a293c373 100644 --- a/src/test/run-fail/issue-948.rs +++ b/src/test/run-fail/issue-948.rs @@ -16,5 +16,5 @@ struct Point { x: int, y: int } fn main() { let origin = Point {x: 0, y: 0}; - let f: Point = Point {x: (fail!("beep boop")),.. origin}; + let f: Point = Point {x: (panic!("beep boop")),.. origin}; } diff --git a/src/test/run-fail/main-fail.rs b/src/test/run-fail/main-fail.rs index ca219fe2183..b750501c265 100644 --- a/src/test/run-fail/main-fail.rs +++ b/src/test/run-fail/main-fail.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:task '<main>' failed at +// error-pattern:task '<main>' panicked at fn main() { - fail!() + panic!() } diff --git a/src/test/run-fail/match-bot-fail.rs b/src/test/run-fail/match-bot-fail.rs index 9d80f07de0a..1b7cace14b0 100644 --- a/src/test/run-fail/match-bot-fail.rs +++ b/src/test/run-fail/match-bot-fail.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:explicit failure +// error-pattern:explicit panic #![allow(unreachable_code)] #![allow(unused_variable)] @@ -17,6 +17,6 @@ fn foo(s: String) { } fn main() { let i = - match Some::<int>(3) { None::<int> => { fail!() } Some::<int>(_) => { fail!() } }; + match Some::<int>(3) { None::<int> => { panic!() } Some::<int>(_) => { panic!() } }; foo(i); } diff --git a/src/test/run-fail/match-disc-bot.rs b/src/test/run-fail/match-disc-bot.rs index 13ccd118c61..da08f53fcde 100644 --- a/src/test/run-fail/match-disc-bot.rs +++ b/src/test/run-fail/match-disc-bot.rs @@ -9,6 +9,6 @@ // except according to those terms. // error-pattern:quux -fn f() -> ! { fail!("quux") } +fn f() -> ! { panic!("quux") } fn g() -> int { match f() { true => { 1 } false => { 0 } } } fn main() { g(); } diff --git a/src/test/run-fail/match-wildcards.rs b/src/test/run-fail/match-wildcards.rs index a4a6739bfc1..5c1a9e1a5e7 100644 --- a/src/test/run-fail/match-wildcards.rs +++ b/src/test/run-fail/match-wildcards.rs @@ -11,9 +11,9 @@ // error-pattern:squirrelcupcake fn cmp() -> int { match (Some('a'), None::<char>) { - (Some(_), _) => { fail!("squirrelcupcake"); } - (_, Some(_)) => { fail!(); } - _ => { fail!("wat"); } + (Some(_), _) => { panic!("squirrelcupcake"); } + (_, Some(_)) => { panic!(); } + _ => { panic!("wat"); } } } diff --git a/src/test/run-fail/native-failure.rs b/src/test/run-fail/native-failure.rs index ae3924ba935..0b261676cb2 100644 --- a/src/test/run-fail/native-failure.rs +++ b/src/test/run-fail/native-failure.rs @@ -9,13 +9,13 @@ // except according to those terms. // ignore-android (FIXME #11419) -// error-pattern:explicit failure +// error-pattern:explicit panic extern crate native; #[start] fn start(argc: int, argv: *const *const u8) -> int { native::start(argc, argv, proc() { - fail!(); + panic!(); }) } diff --git a/src/test/run-fail/rhs-type.rs b/src/test/run-fail/rhs-type.rs index d607ec76c35..ec19e08c74f 100644 --- a/src/test/run-fail/rhs-type.rs +++ b/src/test/run-fail/rhs-type.rs @@ -18,6 +18,6 @@ struct T { t: String } fn main() { - let pth = fail!("bye"); + let pth = panic!("bye"); let _rs: T = T {t: pth}; } diff --git a/src/test/run-fail/rt-set-exit-status-fail.rs b/src/test/run-fail/rt-set-exit-status-fail.rs index c960679a43f..e524a2432ac 100644 --- a/src/test/run-fail/rt-set-exit-status-fail.rs +++ b/src/test/run-fail/rt-set-exit-status-fail.rs @@ -17,8 +17,8 @@ use std::os; fn main() { error!("whatever"); // Setting the exit status only works when the scheduler terminates - // normally. In this case we're going to fail, so instead of + // normally. In this case we're going to panic, so instead of // returning 50 the process will return the typical rt failure code. os::set_exit_status(50); - fail!(); + panic!(); } diff --git a/src/test/run-fail/rt-set-exit-status-fail2.rs b/src/test/run-fail/rt-set-exit-status-fail2.rs index 22985d57936..1cfc6c36a63 100644 --- a/src/test/run-fail/rt-set-exit-status-fail2.rs +++ b/src/test/run-fail/rt-set-exit-status-fail2.rs @@ -20,7 +20,7 @@ struct r { } // Setting the exit status after the runtime has already -// failed has no effect and the process exits with the +// panicked has no effect and the process exits with the // runtime's exit code impl Drop for r { fn drop(&mut self) { @@ -39,5 +39,5 @@ fn main() { task::spawn(proc() { let _i = r(5); }); - fail!(); + panic!(); } diff --git a/src/test/run-fail/rt-set-exit-status.rs b/src/test/run-fail/rt-set-exit-status.rs index d08cb198802..bddf9b5a7ea 100644 --- a/src/test/run-fail/rt-set-exit-status.rs +++ b/src/test/run-fail/rt-set-exit-status.rs @@ -16,7 +16,7 @@ use std::os; fn main() { error!("whatever"); - // 101 is the code the runtime uses on task failure and the value + // 101 is the code the runtime uses on task panic and the value // compiletest expects run-fail tests to return. os::set_exit_status(101); } diff --git a/src/test/run-fail/run-unexported-tests.rs b/src/test/run-fail/run-unexported-tests.rs index 70ef4a0c0c3..0e218740ab1 100644 --- a/src/test/run-fail/run-unexported-tests.rs +++ b/src/test/run-fail/run-unexported-tests.rs @@ -17,5 +17,5 @@ mod m { pub fn exported() { } #[test] - fn unexported() { fail!("runned an unexported test"); } + fn unexported() { panic!("runned an unexported test"); } } diff --git a/src/test/run-fail/str-overrun.rs b/src/test/run-fail/str-overrun.rs index c3ee76047d1..a9c0030feca 100644 --- a/src/test/run-fail/str-overrun.rs +++ b/src/test/run-fail/str-overrun.rs @@ -13,6 +13,6 @@ fn main() { let s: String = "hello".to_string(); - // Bounds-check failure. + // Bounds-check panic. assert_eq!(s.as_bytes()[5], 0x0 as u8); } diff --git a/src/test/run-fail/task-spawn-barefn.rs b/src/test/run-fail/task-spawn-barefn.rs index e7fd97f8d31..dfc3238662c 100644 --- a/src/test/run-fail/task-spawn-barefn.rs +++ b/src/test/run-fail/task-spawn-barefn.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:Ensure that the child task runs by failing +// error-pattern:Ensure that the child task runs by panicking use std::task; @@ -17,10 +17,10 @@ fn main() { // works when provided with a bare function: let r = task::try(startfn); if r.is_err() { - fail!() + panic!() } } fn startfn() { - assert!("Ensure that the child task runs by failing".is_empty()); + assert!("Ensure that the child task runs by panicking".is_empty()); } diff --git a/src/test/run-fail/test-fail.rs b/src/test/run-fail/test-fail.rs index b628f101fd5..cd2ec834d82 100644 --- a/src/test/run-fail/test-fail.rs +++ b/src/test/run-fail/test-fail.rs @@ -9,12 +9,12 @@ // except according to those terms. // check-stdout -// error-pattern:task 'test_foo' failed at +// error-pattern:task 'test_foo' panicked at // compile-flags: --test // ignore-pretty: does not work well with `--test` #[test] fn test_foo() { - fail!() + panic!() } diff --git a/src/test/run-fail/tls-exit-status.rs b/src/test/run-fail/tls-exit-status.rs index 1858ceb2836..5b44e375704 100644 --- a/src/test/run-fail/tls-exit-status.rs +++ b/src/test/run-fail/tls-exit-status.rs @@ -15,5 +15,5 @@ use std::os; fn main() { os::args(); - fail!("please have a nonzero exit status"); + panic!("please have a nonzero exit status"); } diff --git a/src/test/run-fail/too-much-recursion-unwinding.rs b/src/test/run-fail/too-much-recursion-unwinding.rs index 04733552969..2ec670c3306 100644 --- a/src/test/run-fail/too-much-recursion-unwinding.rs +++ b/src/test/run-fail/too-much-recursion-unwinding.rs @@ -11,7 +11,7 @@ // ignore-test leaks // error-pattern:ran out of stack -// Test that the task fails after hitting the recursion limit +// Test that the task panicks after hitting the recursion limit // during unwinding fn recurse() { diff --git a/src/test/run-fail/unique-fail.rs b/src/test/run-fail/unique-fail.rs index f1804c10691..07c9a21c5c1 100644 --- a/src/test/run-fail/unique-fail.rs +++ b/src/test/run-fail/unique-fail.rs @@ -8,5 +8,5 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern: fail -fn main() { box fail!(); } +// error-pattern: panic +fn main() { box panic!(); } diff --git a/src/test/run-fail/unwind-interleaved.rs b/src/test/run-fail/unwind-interleaved.rs index f6a3aa48def..5012ded28b5 100644 --- a/src/test/run-fail/unwind-interleaved.rs +++ b/src/test/run-fail/unwind-interleaved.rs @@ -12,7 +12,7 @@ fn a() { } -fn b() { fail!(); } +fn b() { panic!(); } fn main() { let _x = vec!(0i); diff --git a/src/test/run-fail/unwind-rec.rs b/src/test/run-fail/unwind-rec.rs index 9c96970f0e7..1c72686b602 100644 --- a/src/test/run-fail/unwind-rec.rs +++ b/src/test/run-fail/unwind-rec.rs @@ -12,7 +12,7 @@ fn build() -> Vec<int> { - fail!(); + panic!(); } struct Blk { node: Vec<int> } diff --git a/src/test/run-fail/unwind-rec2.rs b/src/test/run-fail/unwind-rec2.rs index 178d0a8ab32..943b4cd7671 100644 --- a/src/test/run-fail/unwind-rec2.rs +++ b/src/test/run-fail/unwind-rec2.rs @@ -16,7 +16,7 @@ fn build1() -> Vec<int> { } fn build2() -> Vec<int> { - fail!(); + panic!(); } struct Blk { node: Vec<int> , span: Vec<int> } diff --git a/src/test/run-fail/unwind-unique.rs b/src/test/run-fail/unwind-unique.rs index 233d367c4b1..6b5aefbab80 100644 --- a/src/test/run-fail/unwind-unique.rs +++ b/src/test/run-fail/unwind-unique.rs @@ -12,7 +12,7 @@ fn failfn() { - fail!(); + panic!(); } fn main() { diff --git a/src/test/run-fail/vec-overrun.rs b/src/test/run-fail/vec-overrun.rs index 281523a807e..c378e852f89 100644 --- a/src/test/run-fail/vec-overrun.rs +++ b/src/test/run-fail/vec-overrun.rs @@ -15,7 +15,7 @@ fn main() { let v: Vec<int> = vec!(10); let x: uint = 0; assert_eq!(v[x], 10); - // Bounds-check failure. + // Bounds-check panic. assert_eq!(v[x + 2], 20); } diff --git a/src/test/run-fail/while-body-fails.rs b/src/test/run-fail/while-body-fails.rs index 0a0b2608357..6a7d0a1d73e 100644 --- a/src/test/run-fail/while-body-fails.rs +++ b/src/test/run-fail/while-body-fails.rs @@ -11,4 +11,4 @@ #![allow(while_true)] // error-pattern:quux -fn main() { let _x: int = { while true { fail!("quux"); } ; 8 } ; } +fn main() { let _x: int = { while true { panic!("quux"); } ; 8 } ; } diff --git a/src/test/run-fail/while-fail.rs b/src/test/run-fail/while-fail.rs index 24058c4fb93..f6081e497bf 100644 --- a/src/test/run-fail/while-fail.rs +++ b/src/test/run-fail/while-fail.rs @@ -12,5 +12,5 @@ // error-pattern:giraffe fn main() { - fail!({ while true { fail!("giraffe") }; "clandestine" }); + panic!({ while true { panic!("giraffe") }; "clandestine" }); } diff --git a/src/test/run-make/no-duplicate-libs/bar.rs b/src/test/run-make/no-duplicate-libs/bar.rs index 721d16b4810..11834756105 100644 --- a/src/test/run-make/no-duplicate-libs/bar.rs +++ b/src/test/run-make/no-duplicate-libs/bar.rs @@ -19,4 +19,4 @@ pub extern fn bar() {} #[lang = "stack_exhausted"] fn stack_exhausted() {} #[lang = "eh_personality"] fn eh_personality() {} -#[lang = "fail_fmt"] fn fail_fmt() -> ! { loop {} } +#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} } diff --git a/src/test/run-make/no-duplicate-libs/foo.rs b/src/test/run-make/no-duplicate-libs/foo.rs index 3382cc20799..61a2a51da08 100644 --- a/src/test/run-make/no-duplicate-libs/foo.rs +++ b/src/test/run-make/no-duplicate-libs/foo.rs @@ -19,4 +19,4 @@ pub extern fn foo() {} #[lang = "stack_exhausted"] fn stack_exhausted() {} #[lang = "eh_personality"] fn eh_personality() {} -#[lang = "fail_fmt"] fn fail_fmt() -> ! { loop {} } +#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} } diff --git a/src/test/run-make/static-unwinding/main.rs b/src/test/run-make/static-unwinding/main.rs index 9fe78cc2553..9918fbb1ab7 100644 --- a/src/test/run-make/static-unwinding/main.rs +++ b/src/test/run-make/static-unwinding/main.rs @@ -24,7 +24,7 @@ impl Drop for A { fn main() { task::try(proc() { let _a = A; - lib::callback(|| fail!()); + lib::callback(|| panic!()); 1i }); diff --git a/src/test/run-pass/attr-main-2.rs b/src/test/run-pass/attr-main-2.rs index 8ae2c1600aa..2f5e72491be 100644 --- a/src/test/run-pass/attr-main-2.rs +++ b/src/test/run-pass/attr-main-2.rs @@ -10,7 +10,7 @@ pub fn main() { - fail!() + panic!() } #[main] diff --git a/src/test/run-pass/backtrace.rs b/src/test/run-pass/backtrace.rs index f487a1c6be5..7e7399c403a 100644 --- a/src/test/run-pass/backtrace.rs +++ b/src/test/run-pass/backtrace.rs @@ -26,16 +26,16 @@ fn start(argc: int, argv: *const *const u8) -> int { fn foo() { let _v = vec![1i, 2, 3]; if os::getenv("IS_TEST").is_some() { - fail!() + panic!() } } #[inline(never)] fn double() { (|| { - fail!("once"); + panic!("once"); }).finally(|| { - fail!("twice"); + panic!("twice"); }) } diff --git a/src/test/run-pass/binary-minus-without-space.rs b/src/test/run-pass/binary-minus-without-space.rs index 9c6e6ab60ab..8235b91273b 100644 --- a/src/test/run-pass/binary-minus-without-space.rs +++ b/src/test/run-pass/binary-minus-without-space.rs @@ -11,6 +11,6 @@ // Check that issue #954 stays fixed pub fn main() { - match -1i { -1 => {}, _ => fail!("wat") } + match -1i { -1 => {}, _ => panic!("wat") } assert_eq!(1i-1, 0i); } diff --git a/src/test/run-pass/bind-by-move.rs b/src/test/run-pass/bind-by-move.rs index a7d3d99e458..a9fa8449d0f 100644 --- a/src/test/run-pass/bind-by-move.rs +++ b/src/test/run-pass/bind-by-move.rs @@ -16,6 +16,6 @@ pub fn main() { let x = Some(p); match x { Some(z) => { dispose(z); }, - None => fail!() + None => panic!() } } diff --git a/src/test/run-pass/borrowck-macro-interaction-issue-6304.rs b/src/test/run-pass/borrowck-macro-interaction-issue-6304.rs index 10835730fa5..415c660221d 100644 --- a/src/test/run-pass/borrowck-macro-interaction-issue-6304.rs +++ b/src/test/run-pass/borrowck-macro-interaction-issue-6304.rs @@ -32,11 +32,11 @@ impl Foo { ); match s { box Bar2(id, rest) => declare!(id, self.elaborate_stm(rest)), - _ => fail!() + _ => panic!() } } - fn check_id(&mut self, s: int) { fail!() } + fn check_id(&mut self, s: int) { panic!() } } pub fn main() { } diff --git a/src/test/run-pass/byte-literals.rs b/src/test/run-pass/byte-literals.rs index aa45bfd1454..ee8a58a0d33 100644 --- a/src/test/run-pass/byte-literals.rs +++ b/src/test/run-pass/byte-literals.rs @@ -29,12 +29,12 @@ pub fn main() { match 42 { b'*' => {}, - _ => fail!() + _ => panic!() } match 100 { b'a' ... b'z' => {}, - _ => fail!() + _ => panic!() } let expected: &[_] = &[97u8, 10u8, 13u8, 9u8, 92u8, 39u8, 34u8, 0u8, 240u8]; @@ -48,7 +48,7 @@ pub fn main() { let val: &[_] = &[97u8, 10u8]; match val { b"a\n" => {}, - _ => fail!(), + _ => panic!(), } let buf = vec!(97u8, 98, 99, 100); diff --git a/src/test/run-pass/cell-does-not-clone.rs b/src/test/run-pass/cell-does-not-clone.rs index 97310fd9ad2..c7c655b3db4 100644 --- a/src/test/run-pass/cell-does-not-clone.rs +++ b/src/test/run-pass/cell-does-not-clone.rs @@ -20,7 +20,7 @@ impl Clone for Foo { // invoked -- after all, that would permit evil user code to // abuse `Cell` and trigger crashes. - fail!(); + panic!(); } } diff --git a/src/test/run-pass/class-impl-very-parameterized-trait.rs b/src/test/run-pass/class-impl-very-parameterized-trait.rs index dd3a7b86bea..aab06c0339b 100644 --- a/src/test/run-pass/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs @@ -75,7 +75,7 @@ impl<T> MutableMap<int, T> for cat<T> { true } - fn find_mut(&mut self, _k: &int) -> Option<&mut T> { fail!() } + fn find_mut(&mut self, _k: &int) -> Option<&mut T> { panic!() } fn remove(&mut self, k: &int) -> bool { if self.find(k).is_some() { @@ -85,16 +85,16 @@ impl<T> MutableMap<int, T> for cat<T> { } } - fn pop(&mut self, _k: &int) -> Option<T> { fail!() } + fn pop(&mut self, _k: &int) -> Option<T> { panic!() } - fn swap(&mut self, _k: int, _v: T) -> Option<T> { fail!() } + fn swap(&mut self, _k: int, _v: T) -> Option<T> { panic!() } } impl<T> cat<T> { pub fn get(&self, k: &int) -> &T { match self.find(k) { Some(v) => { v } - None => { fail!("epic fail"); } + None => { panic!("epic fail"); } } } diff --git a/src/test/run-pass/cleanup-rvalue-temp-during-incomplete-alloc.rs b/src/test/run-pass/cleanup-rvalue-temp-during-incomplete-alloc.rs index fda4a31375b..97134a9d389 100644 --- a/src/test/run-pass/cleanup-rvalue-temp-during-incomplete-alloc.rs +++ b/src/test/run-pass/cleanup-rvalue-temp-during-incomplete-alloc.rs @@ -14,7 +14,7 @@ // // 1. Partial cleanup of `box` is in scope, // 2. cleanup of return value from `get_bar()` is in scope, -// 3. do_it() fails. +// 3. do_it() panics. // // This led to a bug because `the top-most frame that was to be // cleaned (which happens to be the partial cleanup of `box`) required @@ -33,7 +33,7 @@ enum Conzabble { struct Foo { field: Box<uint> } fn do_it(x: &[uint]) -> Foo { - fail!() + panic!() } fn get_bar(x: uint) -> Vec<uint> { vec!(x * 2) } diff --git a/src/test/run-pass/closure-return-bang.rs b/src/test/run-pass/closure-return-bang.rs index e164aeca013..9b4033ae0d7 100644 --- a/src/test/run-pass/closure-return-bang.rs +++ b/src/test/run-pass/closure-return-bang.rs @@ -15,6 +15,6 @@ fn f(x: || -> !) -> ! { } fn main() { - let x: || -> ! = || fail!(); + let x: || -> ! = || panic!(); let _y: || -> ! = || x(); } diff --git a/src/test/run-pass/conditional-compile.rs b/src/test/run-pass/conditional-compile.rs index 116aa462a0a..e5891b2f48d 100644 --- a/src/test/run-pass/conditional-compile.rs +++ b/src/test/run-pass/conditional-compile.rs @@ -80,7 +80,7 @@ mod m { // Since the bogus configuration isn't defined main will just be // parsed, but nothing further will be done with it #[cfg(bogus)] -pub fn main() { fail!() } +pub fn main() { panic!() } pub fn main() { // Exercise some of the configured items in ways that wouldn't be possible @@ -94,7 +94,7 @@ pub fn main() { fn test_in_fn_ctxt() { #[cfg(bogus)] - fn f() { fail!() } + fn f() { panic!() } fn f() { } f(); diff --git a/src/test/run-pass/conditional-debug-macro-off.rs b/src/test/run-pass/conditional-debug-macro-off.rs index 29d329d46a0..f87d92dc16f 100644 --- a/src/test/run-pass/conditional-debug-macro-off.rs +++ b/src/test/run-pass/conditional-debug-macro-off.rs @@ -16,6 +16,6 @@ extern crate log; pub fn main() { - // only fails if println! evaluates its argument. - debug!("{}", { if true { fail!() } }); + // only panics if println! evaluates its argument. + debug!("{}", { if true { panic!() } }); } diff --git a/src/test/run-pass/conditional-debug-macro-on.rs b/src/test/run-pass/conditional-debug-macro-on.rs index 9d09740f3b4..0591828bb13 100644 --- a/src/test/run-pass/conditional-debug-macro-on.rs +++ b/src/test/run-pass/conditional-debug-macro-on.rs @@ -12,8 +12,8 @@ pub fn main() { // exits early if println! evaluates its arguments, otherwise it - // will hit the fail. + // will hit the panic. println!("{}", { if true { return; } }); - fail!(); + panic!(); } diff --git a/src/test/run-pass/const-big-enum.rs b/src/test/run-pass/const-big-enum.rs index ac2e879ceac..1b9bd5e5692 100644 --- a/src/test/run-pass/const-big-enum.rs +++ b/src/test/run-pass/const-big-enum.rs @@ -19,18 +19,18 @@ static X: Foo = Baz; pub fn main() { match X { Baz => {} - _ => fail!() + _ => panic!() } match Y { Bar(s) => assert!(s == 2654435769), - _ => fail!() + _ => panic!() } match Z { Quux(d,h) => { assert_eq!(d, 0x123456789abcdef0); assert_eq!(h, 0x1234); } - _ => fail!() + _ => panic!() } } diff --git a/src/test/run-pass/const-enum-byref-self.rs b/src/test/run-pass/const-enum-byref-self.rs index eaca18be93a..465830c6e12 100644 --- a/src/test/run-pass/const-enum-byref-self.rs +++ b/src/test/run-pass/const-enum-byref-self.rs @@ -15,7 +15,7 @@ impl E { pub fn method(&self) { match *self { V => {} - VV(..) => fail!() + VV(..) => panic!() } } } diff --git a/src/test/run-pass/const-enum-byref.rs b/src/test/run-pass/const-enum-byref.rs index ee7e3c7c663..4cad4acf147 100644 --- a/src/test/run-pass/const-enum-byref.rs +++ b/src/test/run-pass/const-enum-byref.rs @@ -14,7 +14,7 @@ static C: E = V; fn f(a: &E) { match *a { V => {} - VV(..) => fail!() + VV(..) => panic!() } } diff --git a/src/test/run-pass/const-enum-ptr.rs b/src/test/run-pass/const-enum-ptr.rs index c1e3889d613..02d8fcf201d 100644 --- a/src/test/run-pass/const-enum-ptr.rs +++ b/src/test/run-pass/const-enum-ptr.rs @@ -14,6 +14,6 @@ static C: &'static E = &V0; pub fn main() { match *C { V0 => (), - _ => fail!() + _ => panic!() } } diff --git a/src/test/run-pass/const-enum-structlike.rs b/src/test/run-pass/const-enum-structlike.rs index c4e36ba7b4e..3cd7db69f07 100644 --- a/src/test/run-pass/const-enum-structlike.rs +++ b/src/test/run-pass/const-enum-structlike.rs @@ -19,7 +19,7 @@ static C: E = S1 { u: 23 }; pub fn main() { match C { - S0 { .. } => fail!(), + S0 { .. } => panic!(), S1 { u } => assert!(u == 23) } } diff --git a/src/test/run-pass/const-enum-vec-index.rs b/src/test/run-pass/const-enum-vec-index.rs index 2a00daa3c03..9177cad9d62 100644 --- a/src/test/run-pass/const-enum-vec-index.rs +++ b/src/test/run-pass/const-enum-vec-index.rs @@ -19,19 +19,19 @@ static D1: E = C[1]; pub fn main() { match C0 { V0 => (), - _ => fail!() + _ => panic!() } match C1 { V1(n) => assert!(n == 0xDEADBEE), - _ => fail!() + _ => panic!() } match D0 { V0 => (), - _ => fail!() + _ => panic!() } match D1 { V1(n) => assert!(n == 0xDEADBEE), - _ => fail!() + _ => panic!() } } diff --git a/src/test/run-pass/const-enum-vec-ptr.rs b/src/test/run-pass/const-enum-vec-ptr.rs index 95c4ed836c7..8723b2815da 100644 --- a/src/test/run-pass/const-enum-vec-ptr.rs +++ b/src/test/run-pass/const-enum-vec-ptr.rs @@ -14,10 +14,10 @@ static C: &'static [E] = &[V0, V1(0xDEADBEE), V0]; pub fn main() { match C[1] { V1(n) => assert!(n == 0xDEADBEE), - _ => fail!() + _ => panic!() } match C[2] { V0 => (), - _ => fail!() + _ => panic!() } } diff --git a/src/test/run-pass/const-enum-vector.rs b/src/test/run-pass/const-enum-vector.rs index 3dc5b918f7f..e94e1de2e2d 100644 --- a/src/test/run-pass/const-enum-vector.rs +++ b/src/test/run-pass/const-enum-vector.rs @@ -14,10 +14,10 @@ static C: [E, ..3] = [V0, V1(0xDEADBEE), V0]; pub fn main() { match C[1] { V1(n) => assert!(n == 0xDEADBEE), - _ => fail!() + _ => panic!() } match C[2] { V0 => (), - _ => fail!() + _ => panic!() } } diff --git a/src/test/run-pass/const-nullary-enum.rs b/src/test/run-pass/const-nullary-enum.rs index bc61c8e9aec..2d023317db6 100644 --- a/src/test/run-pass/const-nullary-enum.rs +++ b/src/test/run-pass/const-nullary-enum.rs @@ -19,11 +19,11 @@ static X: Foo = Bar; pub fn main() { match X { Bar => {} - Baz | Boo => fail!() + Baz | Boo => panic!() } match Y { Baz => {} - Bar | Boo => fail!() + Bar | Boo => panic!() } } diff --git a/src/test/run-pass/core-run-destroy.rs b/src/test/run-pass/core-run-destroy.rs index b4a54b599fe..d8dfb433e6d 100644 --- a/src/test/run-pass/core-run-destroy.rs +++ b/src/test/run-pass/core-run-destroy.rs @@ -25,14 +25,14 @@ use std::time::Duration; use std::str; macro_rules! succeed( ($e:expr) => ( - match $e { Ok(..) => {}, Err(e) => fail!("failure: {}", e) } + match $e { Ok(..) => {}, Err(e) => panic!("panic: {}", e) } ) ) fn test_destroy_once() { let mut p = sleeper(); match p.signal_exit() { Ok(()) => {} - Err(e) => fail!("error: {}", e), + Err(e) => panic!("error: {}", e), } } @@ -91,7 +91,7 @@ pub fn test_destroy_actually_kills(force: bool) { } }); match p.wait().unwrap() { - ExitStatus(..) => fail!("expected a signal"), + ExitStatus(..) => panic!("expected a signal"), ExitSignal(..) => tx.send(()), } } diff --git a/src/test/run-pass/deriving-cmp-shortcircuit.rs b/src/test/run-pass/deriving-cmp-shortcircuit.rs index df5c58ff04b..fd59b804da3 100644 --- a/src/test/run-pass/deriving-cmp-shortcircuit.rs +++ b/src/test/run-pass/deriving-cmp-shortcircuit.rs @@ -9,22 +9,22 @@ // except according to those terms. // check that the derived impls for the comparison traits shortcircuit -// where possible, by having a type that fails when compared as the +// where possible, by having a type that panics when compared as the // second element, so this passes iff the instances shortcircuit. pub struct FailCmp; impl PartialEq for FailCmp { - fn eq(&self, _: &FailCmp) -> bool { fail!("eq") } + fn eq(&self, _: &FailCmp) -> bool { panic!("eq") } } impl PartialOrd for FailCmp { - fn partial_cmp(&self, _: &FailCmp) -> Option<Ordering> { fail!("partial_cmp") } + fn partial_cmp(&self, _: &FailCmp) -> Option<Ordering> { panic!("partial_cmp") } } impl Eq for FailCmp {} impl Ord for FailCmp { - fn cmp(&self, _: &FailCmp) -> Ordering { fail!("cmp") } + fn cmp(&self, _: &FailCmp) -> Ordering { panic!("cmp") } } #[deriving(PartialEq,PartialOrd,Eq,Ord)] diff --git a/src/test/run-pass/die-macro.rs b/src/test/run-pass/die-macro.rs index df1e4132cb7..565e33ce01e 100644 --- a/src/test/run-pass/die-macro.rs +++ b/src/test/run-pass/die-macro.rs @@ -8,14 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Just testing that fail!() type checks in statement or expr +// Just testing that panic!() type checks in statement or expr #![allow(unreachable_code)] fn f() { - fail!(); + panic!(); - let _x: int = fail!(); + let _x: int = panic!(); } pub fn main() { diff --git a/src/test/run-pass/drop-trait-enum.rs b/src/test/run-pass/drop-trait-enum.rs index 977eaa13fc1..6f4e927abd5 100644 --- a/src/test/run-pass/drop-trait-enum.rs +++ b/src/test/run-pass/drop-trait-enum.rs @@ -44,7 +44,7 @@ impl Drop for Foo { sender.send(DestructorRan); } &FailingVariant { .. } => { - fail!("Failed"); + panic!("Failed"); } } } diff --git a/src/test/run-pass/dst-deref-mut.rs b/src/test/run-pass/dst-deref-mut.rs index 465529ac909..c2707a1ae6e 100644 --- a/src/test/run-pass/dst-deref-mut.rs +++ b/src/test/run-pass/dst-deref-mut.rs @@ -16,7 +16,7 @@ pub struct Arr { impl Deref<[uint]> for Arr { fn deref(&self) -> &[uint] { - fail!(); + panic!(); } } diff --git a/src/test/run-pass/enum-alignment.rs b/src/test/run-pass/enum-alignment.rs index a1ef12a7657..27560986e02 100644 --- a/src/test/run-pass/enum-alignment.rs +++ b/src/test/run-pass/enum-alignment.rs @@ -24,7 +24,7 @@ fn is_aligned<T>(ptr: &T) -> bool { pub fn main() { let x = Some(0u64); match x { - None => fail!(), + None => panic!(), Some(ref y) => assert!(is_aligned(y)) } } diff --git a/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs b/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs index 24fb503aea3..d6cdce7390a 100644 --- a/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs +++ b/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs @@ -20,6 +20,6 @@ pub fn main() { match Cons(10i, box Nil) { Cons(10i, _) => {} Nil => {} - _ => fail!() + _ => panic!() } } diff --git a/src/test/run-pass/expr-if-fail-all.rs b/src/test/run-pass/expr-if-fail-all.rs index 8e56011e6dc..0dd7ddc3f84 100644 --- a/src/test/run-pass/expr-if-fail-all.rs +++ b/src/test/run-pass/expr-if-fail-all.rs @@ -8,12 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// When all branches of an if expression result in fail, the entire if -// expression results in fail. +// When all branches of an if expression result in panic, the entire if +// expression results in panic. pub fn main() { let _x = if true { 10i } else { - if true { fail!() } else { fail!() } + if true { panic!() } else { panic!() } }; } diff --git a/src/test/run-pass/expr-if-fail.rs b/src/test/run-pass/expr-if-fail.rs index e9f116fcdd4..aa4240c60f1 100644 --- a/src/test/run-pass/expr-if-fail.rs +++ b/src/test/run-pass/expr-if-fail.rs @@ -8,19 +8,19 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn test_if_fail() { - let x = if false { fail!() } else { 10i }; +fn test_if_panic() { + let x = if false { panic!() } else { 10i }; assert!((x == 10)); } -fn test_else_fail() { - let x = if true { 10i } else { fail!() }; +fn test_else_panic() { + let x = if true { 10i } else { panic!() }; assert_eq!(x, 10i); } -fn test_elseif_fail() { - let x = if false { 0i } else if false { fail!() } else { 10i }; +fn test_elseif_panic() { + let x = if false { 0i } else if false { panic!() } else { 10i }; assert_eq!(x, 10i); } -pub fn main() { test_if_fail(); test_else_fail(); test_elseif_fail(); } +pub fn main() { test_if_panic(); test_else_panic(); test_elseif_panic(); } diff --git a/src/test/run-pass/expr-match-fail-all.rs b/src/test/run-pass/expr-match-fail-all.rs index 0d23098d8fc..3b33c18bbbd 100644 --- a/src/test/run-pass/expr-match-fail-all.rs +++ b/src/test/run-pass/expr-match-fail-all.rs @@ -11,12 +11,12 @@ -// When all branches of a match expression result in fail, the entire -// match expression results in fail. +// When all branches of a match expression result in panic, the entire +// match expression results in panic. pub fn main() { let _x = match true { true => { 10i } - false => { match true { true => { fail!() } false => { fail!() } } } + false => { match true { true => { panic!() } false => { panic!() } } } }; } diff --git a/src/test/run-pass/expr-match-fail.rs b/src/test/run-pass/expr-match-fail.rs index 1f246581687..d8ee21dfdc6 100644 --- a/src/test/run-pass/expr-match-fail.rs +++ b/src/test/run-pass/expr-match-fail.rs @@ -10,12 +10,12 @@ fn test_simple() { - let r = match true { true => { true } false => { fail!() } }; + let r = match true { true => { true } false => { panic!() } }; assert_eq!(r, true); } fn test_box() { - let r = match true { true => { vec!(10i) } false => { fail!() } }; + let r = match true { true => { vec!(10i) } false => { panic!() } }; assert_eq!(r[0], 10i); } diff --git a/src/test/run-pass/expr-match-generic-unique1.rs b/src/test/run-pass/expr-match-generic-unique1.rs index e2f8f7c8ebf..aed4024b5bc 100644 --- a/src/test/run-pass/expr-match-generic-unique1.rs +++ b/src/test/run-pass/expr-match-generic-unique1.rs @@ -14,7 +14,7 @@ type compare<T> = |Box<T>, Box<T>|: 'static -> bool; fn test_generic<T:Clone>(expected: Box<T>, eq: compare<T>) { let actual: Box<T> = match true { true => { expected.clone() }, - _ => fail!("wat") + _ => panic!("wat") }; assert!((eq(expected, actual))); } diff --git a/src/test/run-pass/expr-match-generic-unique2.rs b/src/test/run-pass/expr-match-generic-unique2.rs index a9b02a6e799..89adef378f1 100644 --- a/src/test/run-pass/expr-match-generic-unique2.rs +++ b/src/test/run-pass/expr-match-generic-unique2.rs @@ -14,7 +14,7 @@ type compare<'a, T> = |T, T|: 'a -> bool; fn test_generic<T:Clone>(expected: T, eq: compare<T>) { let actual: T = match true { true => expected.clone(), - _ => fail!("wat") + _ => panic!("wat") }; assert!((eq(expected, actual))); } diff --git a/src/test/run-pass/expr-match-generic.rs b/src/test/run-pass/expr-match-generic.rs index ff19862fee3..c74caf4de4b 100644 --- a/src/test/run-pass/expr-match-generic.rs +++ b/src/test/run-pass/expr-match-generic.rs @@ -12,7 +12,7 @@ type compare<T> = extern "Rust" fn(T, T) -> bool; fn test_generic<T:Clone>(expected: T, eq: compare<T>) { - let actual: T = match true { true => { expected.clone() }, _ => fail!("wat") }; + let actual: T = match true { true => { expected.clone() }, _ => panic!("wat") }; assert!((eq(expected, actual))); } diff --git a/src/test/run-pass/expr-match-struct.rs b/src/test/run-pass/expr-match-struct.rs index 3d01c6653a7..21b0c28495e 100644 --- a/src/test/run-pass/expr-match-struct.rs +++ b/src/test/run-pass/expr-match-struct.rs @@ -16,7 +16,7 @@ struct R { i: int } fn test_rec() { - let rs = match true { true => R {i: 100}, _ => fail!() }; + let rs = match true { true => R {i: 100}, _ => panic!() }; assert_eq!(rs.i, 100); } diff --git a/src/test/run-pass/expr-match-unique.rs b/src/test/run-pass/expr-match-unique.rs index 3ee0a232d19..83f2ada02b0 100644 --- a/src/test/run-pass/expr-match-unique.rs +++ b/src/test/run-pass/expr-match-unique.rs @@ -11,7 +11,7 @@ // Tests for match as expressions resulting in boxed types fn test_box() { - let res = match true { true => { box 100i }, _ => fail!() }; + let res = match true { true => { box 100i }, _ => panic!() }; assert_eq!(*res, 100i); } diff --git a/src/test/run-pass/fail-during-tld-destroy.rs b/src/test/run-pass/fail-during-tld-destroy.rs index 3faa30c4c8a..2f0d6cf90aa 100644 --- a/src/test/run-pass/fail-during-tld-destroy.rs +++ b/src/test/run-pass/fail-during-tld-destroy.rs @@ -16,7 +16,7 @@ struct Foo; impl Drop for Foo { fn drop(&mut self) { unsafe { DROPS += 1; } - fail!() + panic!() } } diff --git a/src/test/run-pass/fail-in-dtor-drops-fields.rs b/src/test/run-pass/fail-in-dtor-drops-fields.rs index be4a497989c..46924c74a8c 100644 --- a/src/test/run-pass/fail-in-dtor-drops-fields.rs +++ b/src/test/run-pass/fail-in-dtor-drops-fields.rs @@ -22,7 +22,7 @@ struct B { impl Drop for A { fn drop(&mut self) { - fail!() + panic!() } } diff --git a/src/test/run-pass/for-loop-fail.rs b/src/test/run-pass/for-loop-fail.rs index c0f6b14dc27..d157da3139f 100644 --- a/src/test/run-pass/for-loop-fail.rs +++ b/src/test/run-pass/for-loop-fail.rs @@ -9,4 +9,4 @@ // except according to those terms. -pub fn main() { let x: Vec<int> = Vec::new(); for _ in x.iter() { fail!("moop"); } } +pub fn main() { let x: Vec<int> = Vec::new(); for _ in x.iter() { panic!("moop"); } } diff --git a/src/test/run-pass/getopts_ref.rs b/src/test/run-pass/getopts_ref.rs index afa4b7a1ad0..a3df98afcb0 100644 --- a/src/test/run-pass/getopts_ref.rs +++ b/src/test/run-pass/getopts_ref.rs @@ -19,7 +19,7 @@ pub fn main() { match getopts(args.as_slice(), opts.as_slice()) { Ok(ref m) => assert!(!m.opt_present("b")), - Err(ref f) => fail!("{}", *f) + Err(ref f) => panic!("{}", *f) }; } diff --git a/src/test/run-pass/hygienic-labels.rs b/src/test/run-pass/hygienic-labels.rs index abb0bdab71f..53c081ff83e 100644 --- a/src/test/run-pass/hygienic-labels.rs +++ b/src/test/run-pass/hygienic-labels.rs @@ -35,23 +35,23 @@ pub fn main() { 'x: for _ in range(0i, 1) { // this 'x should refer to the outer loop, lexically loop_x!(break 'x); - fail!("break doesn't act hygienically inside for loop"); + panic!("break doesn't act hygienically inside for loop"); } 'x: loop { // ditto loop_x!(break 'x); - fail!("break doesn't act hygienically inside infinite loop"); + panic!("break doesn't act hygienically inside infinite loop"); } 'x: while 1i + 1 == 2 { while_x!(break 'x); - fail!("break doesn't act hygienically inside infinite while loop"); + panic!("break doesn't act hygienically inside infinite while loop"); } 'x: for _ in range(0i, 1) { // ditto run_once!(continue 'x); - fail!("continue doesn't act hygienically inside for loop"); + panic!("continue doesn't act hygienically inside for loop"); } } diff --git a/src/test/run-pass/if-bot.rs b/src/test/run-pass/if-bot.rs index bfe3e9beddc..44c834d233f 100644 --- a/src/test/run-pass/if-bot.rs +++ b/src/test/run-pass/if-bot.rs @@ -9,6 +9,6 @@ // except according to those terms. pub fn main() { - let i: int = if false { fail!() } else { 5 }; + let i: int = if false { panic!() } else { 5 }; println!("{}", i); } diff --git a/src/test/run-pass/if-check.rs b/src/test/run-pass/if-check.rs index 22b5281ef38..660a6147d08 100644 --- a/src/test/run-pass/if-check.rs +++ b/src/test/run-pass/if-check.rs @@ -18,7 +18,7 @@ fn foo(x: uint) { if even(x) { println!("{}", x); } else { - fail!(); + panic!(); } } diff --git a/src/test/run-pass/if-let.rs b/src/test/run-pass/if-let.rs index 4bf3a85677c..a07b7832786 100644 --- a/src/test/run-pass/if-let.rs +++ b/src/test/run-pass/if-let.rs @@ -15,7 +15,7 @@ pub fn main() { if let Some(y) = x { assert_eq!(y, 3i); } else { - fail!("if-let failed"); + panic!("if-let panicked"); } let mut worked = false; if let Some(_) = x { @@ -35,9 +35,9 @@ pub fn main() { assert_eq!(clause, 4u); if 3i > 4 { - fail!("bad math"); + panic!("bad math"); } else if let 1 = 2i { - fail!("bad pattern match"); + panic!("bad pattern match"); } enum Foo { @@ -48,22 +48,22 @@ pub fn main() { let foo = Three("three".to_string(), 42i); if let One = foo { - fail!("bad pattern match"); + panic!("bad pattern match"); } else if let Two(_x) = foo { - fail!("bad pattern match"); + panic!("bad pattern match"); } else if let Three(s, _) = foo { assert_eq!(s.as_slice(), "three"); } else { - fail!("bad else"); + panic!("bad else"); } if false { - fail!("wat"); + panic!("wat"); } else if let a@Two(_) = Two(42u) { if let Two(b) = a { assert_eq!(b, 42u); } else { - fail!("fail in nested if-let"); + panic!("panic in nested if-let"); } } } diff --git a/src/test/run-pass/inherent-trait-method-order.rs b/src/test/run-pass/inherent-trait-method-order.rs index 416c0701804..6643636c570 100644 --- a/src/test/run-pass/inherent-trait-method-order.rs +++ b/src/test/run-pass/inherent-trait-method-order.rs @@ -13,7 +13,7 @@ struct Foo; impl Foo { #[allow(dead_code)] fn foo(self) { - fail!("wrong method!") + panic!("wrong method!") } } diff --git a/src/test/run-pass/issue-10392.rs b/src/test/run-pass/issue-10392.rs index 796fae7dc32..1aa9c96de1a 100644 --- a/src/test/run-pass/issue-10392.rs +++ b/src/test/run-pass/issue-10392.rs @@ -11,8 +11,8 @@ struct A { foo: int } struct B { a: int, b: int, c: int } -fn mka() -> A { fail!() } -fn mkb() -> B { fail!() } +fn mka() -> A { panic!() } +fn mkb() -> B { panic!() } fn test() { let A { foo, } = mka(); diff --git a/src/test/run-pass/issue-10734.rs b/src/test/run-pass/issue-10734.rs index a30cf717328..1c267f48337 100644 --- a/src/test/run-pass/issue-10734.rs +++ b/src/test/run-pass/issue-10734.rs @@ -35,7 +35,7 @@ pub fn main() { // An `if false {} else { expr }` statement should compile the same as `{ expr }`. if false { - fail!(); + panic!(); } else { let _a = Foo{ dropped: false }; } diff --git a/src/test/run-pass/issue-11552.rs b/src/test/run-pass/issue-11552.rs index 42b5bbc8623..106bb7f701c 100644 --- a/src/test/run-pass/issue-11552.rs +++ b/src/test/run-pass/issue-11552.rs @@ -20,7 +20,7 @@ fn fas(n: &Noun) -> Noun { match n { &Cell(box Atom(2), box Cell(ref a, _)) => (**a).clone(), - _ => fail!("Invalid fas pattern") + _ => panic!("Invalid fas pattern") } } diff --git a/src/test/run-pass/issue-11709.rs b/src/test/run-pass/issue-11709.rs index d299b853aee..0567a5836ab 100644 --- a/src/test/run-pass/issue-11709.rs +++ b/src/test/run-pass/issue-11709.rs @@ -10,10 +10,10 @@ // ignore-pretty -// Don't fail on blocks without results +// Don't panic on blocks without results // There are several tests in this run-pass that raised // when this bug was opened. The cases where the compiler -// failed before the fix have a comment. +// panics before the fix have a comment. struct S {x:()} @@ -31,8 +31,8 @@ fn not(b: bool) -> bool { if b { !b } else { - // `fail!(...)` would break - fail!("Break the compiler"); + // `panic!(...)` would break + panic!("Break the compiler"); } } diff --git a/src/test/run-pass/issue-13259-windows-tcb-trash.rs b/src/test/run-pass/issue-13259-windows-tcb-trash.rs index 1a909db92e3..0e42bdbd6ad 100644 --- a/src/test/run-pass/issue-13259-windows-tcb-trash.rs +++ b/src/test/run-pass/issue-13259-windows-tcb-trash.rs @@ -32,7 +32,7 @@ mod imp { FormatMessageW(0x1000, 0 as *mut c_void, 1, 0x400, buf.as_mut_ptr(), buf.len() as u32, 0 as *const c_void) }; - // On some 32-bit Windowses (Win7-8 at least) this will fail with segmented + // On some 32-bit Windowses (Win7-8 at least) this will panic with segmented // stacks taking control of pvArbitrary assert!(ret != 0); } diff --git a/src/test/run-pass/issue-14865.rs b/src/test/run-pass/issue-14865.rs index c84b1eae8e0..e3cc653909f 100644 --- a/src/test/run-pass/issue-14865.rs +++ b/src/test/run-pass/issue-14865.rs @@ -17,14 +17,14 @@ fn main() { let x = match Foo(42) { Foo(..) => 1i, _ if true => 0, - Bar(..) => fail!("Oh dear") + Bar(..) => panic!("Oh dear") }; assert_eq!(x, 1); let x = match Foo(42) { _ if true => 0i, Foo(..) => 1, - Bar(..) => fail!("Oh dear") + Bar(..) => panic!("Oh dear") }; assert_eq!(x, 0); } diff --git a/src/test/run-pass/issue-1516.rs b/src/test/run-pass/issue-1516.rs index 3aaa480d776..3c5af9ca032 100644 --- a/src/test/run-pass/issue-1516.rs +++ b/src/test/run-pass/issue-1516.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn main() { - let early_error: |&str|: 'static -> ! = |_msg| { fail!() }; + let early_error: |&str|: 'static -> ! = |_msg| { panic!() }; } diff --git a/src/test/run-pass/issue-2311-2.rs b/src/test/run-pass/issue-2311-2.rs index b03bfb958af..e0b98ab1965 100644 --- a/src/test/run-pass/issue-2311-2.rs +++ b/src/test/run-pass/issue-2311-2.rs @@ -15,7 +15,7 @@ struct foo<A> { impl<A> foo<A> { pub fn bar<B,C:clam<A>>(&self, _c: C) -> B { - fail!(); + panic!(); } } diff --git a/src/test/run-pass/issue-2312.rs b/src/test/run-pass/issue-2312.rs index 14b5efe904d..8c597552d75 100644 --- a/src/test/run-pass/issue-2312.rs +++ b/src/test/run-pass/issue-2312.rs @@ -15,7 +15,7 @@ trait clam<A> { } struct foo(int); impl foo { - pub fn bar<B,C:clam<B>>(&self, _c: C) -> B { fail!(); } + pub fn bar<B,C:clam<B>>(&self, _c: C) -> B { panic!(); } } pub fn main() { } diff --git a/src/test/run-pass/issue-2611-3.rs b/src/test/run-pass/issue-2611-3.rs index 8a9e2d28776..2608c89d155 100644 --- a/src/test/run-pass/issue-2611-3.rs +++ b/src/test/run-pass/issue-2611-3.rs @@ -20,7 +20,7 @@ struct E { } impl A for E { - fn b<F,G>(_x: F) -> F { fail!() } + fn b<F,G>(_x: F) -> F { panic!() } //~^ ERROR in method `b`, type parameter 0 has 1 bound, but } diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index c52dd5ce5e4..cb17b7f6a6c 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -56,9 +56,9 @@ pub mod pipes { } mod rusti { - pub fn atomic_xchg(_dst: &mut int, _src: int) -> int { fail!(); } - pub fn atomic_xchg_acq(_dst: &mut int, _src: int) -> int { fail!(); } - pub fn atomic_xchg_rel(_dst: &mut int, _src: int) -> int { fail!(); } + pub fn atomic_xchg(_dst: &mut int, _src: int) -> int { panic!(); } + pub fn atomic_xchg_acq(_dst: &mut int, _src: int) -> int { panic!(); } + pub fn atomic_xchg_rel(_dst: &mut int, _src: int) -> int { panic!(); } } // We should consider moving this to ::std::unsafe, although I @@ -92,7 +92,7 @@ pub mod pipes { // The receiver will eventually clean this up. unsafe { forget(p); } } - full => { fail!("duplicate send") } + full => { panic!("duplicate send") } blocked => { // The receiver will eventually clean this up. @@ -134,7 +134,7 @@ pub mod pipes { } full => { // This is impossible - fail!("you dun goofed") + panic!("you dun goofed") } terminated => { // I have to clean up, use drop_glue @@ -151,7 +151,7 @@ pub mod pipes { } blocked => { // this shouldn't happen. - fail!("terminating a blocked packet") + panic!("terminating a blocked packet") } terminated | full => { // I have to clean up, use drop_glue @@ -236,7 +236,7 @@ pub mod pingpong { let _addr : *const ::pipes::send_packet<pong> = match &p { &ping(ref x) => { mem::transmute(x) } }; - fail!() + panic!() } } @@ -245,7 +245,7 @@ pub mod pingpong { let _addr : *const ::pipes::send_packet<ping> = match &p { &pong(ref x) => { mem::transmute(x) } }; - fail!() + panic!() } } @@ -269,7 +269,7 @@ pub mod pingpong { pub fn do_pong(c: pong) -> (ping, ()) { let packet = ::pipes::recv(c); if packet.is_none() { - fail!("sender closed the connection") + panic!("sender closed the connection") } (pingpong::liberate_pong(packet.unwrap()), ()) } @@ -284,7 +284,7 @@ pub mod pingpong { pub fn do_ping(c: ping) -> (pong, ()) { let packet = ::pipes::recv(c); if packet.is_none() { - fail!("sender closed the connection") + panic!("sender closed the connection") } (pingpong::liberate_ping(packet.unwrap()), ()) } diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index 1964001cebd..04866c56913 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -53,7 +53,7 @@ fn square_from_char(c: char) -> square { ' ' => { empty } _ => { println!("invalid square: {}", c); - fail!() + panic!() } } } diff --git a/src/test/run-pass/issue-3895.rs b/src/test/run-pass/issue-3895.rs index efe0cb8d491..ee075db2723 100644 --- a/src/test/run-pass/issue-3895.rs +++ b/src/test/run-pass/issue-3895.rs @@ -13,6 +13,6 @@ pub fn main() { match BadChar { _ if true => BadChar, - BadChar | BadSyntax => fail!() , + BadChar | BadSyntax => panic!() , }; } diff --git a/src/test/run-pass/issue-4016.rs b/src/test/run-pass/issue-4016.rs index 20b818f47d4..e5cc8414f06 100644 --- a/src/test/run-pass/issue-4016.rs +++ b/src/test/run-pass/issue-4016.rs @@ -19,7 +19,7 @@ fn exec<T: JD>() { let doc = json::from_str("").unwrap(); let mut decoder = json::Decoder::new(doc); let _v: T = Decodable::decode(&mut decoder).unwrap(); - fail!() + panic!() } pub fn main() {} diff --git a/src/test/run-pass/issue-4241.rs b/src/test/run-pass/issue-4241.rs index d8c08f8ac32..3130c0441a5 100644 --- a/src/test/run-pass/issue-4241.rs +++ b/src/test/run-pass/issue-4241.rs @@ -48,7 +48,7 @@ priv fn parse_list(len: uint, io: @io::Reader) -> Result { let v = match io.read_char() { '$' => parse_bulk(io), ':' => parse_int(io), - _ => fail!() + _ => panic!() }; list.push(v); } @@ -61,26 +61,26 @@ priv fn chop(s: String) -> String { priv fn parse_bulk(io: @io::Reader) -> Result { match from_str::<int>(chop(io.read_line())) { - None => fail!(), + None => panic!(), Some(-1) => Nil, Some(len) if len >= 0 => parse_data(len as uint, io), - Some(_) => fail!() + Some(_) => panic!() } } priv fn parse_multi(io: @io::Reader) -> Result { match from_str::<int>(chop(io.read_line())) { - None => fail!(), + None => panic!(), Some(-1) => Nil, Some(0) => List(~[]), Some(len) if len >= 0 => parse_list(len as uint, io), - Some(_) => fail!() + Some(_) => panic!() } } priv fn parse_int(io: @io::Reader) -> Result { match from_str::<int>(chop(io.read_line())) { - None => fail!(), + None => panic!(), Some(i) => Int(i) } } @@ -92,7 +92,7 @@ priv fn parse_response(io: @io::Reader) -> Result { '+' => Status(chop(io.read_line())), '-' => Error(chop(io.read_line())), ':' => parse_int(io), - _ => fail!() + _ => panic!() } } diff --git a/src/test/run-pass/issue-5521.rs b/src/test/run-pass/issue-5521.rs index be75c723042..fb0e8e599eb 100644 --- a/src/test/run-pass/issue-5521.rs +++ b/src/test/run-pass/issue-5521.rs @@ -15,7 +15,7 @@ extern crate "issue-5521" as foo; fn bar(a: foo::map) { if false { - fail!(); + panic!(); } else { let _b = &(*a)[2]; } diff --git a/src/test/run-pass/issue-6128.rs b/src/test/run-pass/issue-6128.rs index 29775e4a699..4b31f393309 100644 --- a/src/test/run-pass/issue-6128.rs +++ b/src/test/run-pass/issue-6128.rs @@ -19,7 +19,7 @@ trait Graph<Node, Edge> { impl<E> Graph<int, E> for HashMap<int, int> { fn f(&self, _e: E) { - fail!(); + panic!(); } } diff --git a/src/test/run-pass/issue-6449.rs b/src/test/run-pass/issue-6449.rs index 48e2890b259..5a6dea8d15b 100644 --- a/src/test/run-pass/issue-6449.rs +++ b/src/test/run-pass/issue-6449.rs @@ -20,25 +20,25 @@ enum Other { fn main() { match Baz { - ::Bar(3) => fail!(), - ::Bar(_) if false => fail!(), - ::Bar(..) if false => fail!(), - ::Bar(_n) => fail!(), + ::Bar(3) => panic!(), + ::Bar(_) if false => panic!(), + ::Bar(..) if false => panic!(), + ::Bar(_n) => panic!(), ::Baz => {} } match Bar(3) { ::Bar(3) => {} - ::Bar(_) if false => fail!(), - ::Bar(..) if false => fail!(), - ::Bar(_n) => fail!(), - ::Baz => fail!(), + ::Bar(_) if false => panic!(), + ::Bar(..) if false => panic!(), + ::Bar(_n) => panic!(), + ::Baz => panic!(), } match Bar(4) { - ::Bar(3) => fail!(), - ::Bar(_) if false => fail!(), - ::Bar(..) if false => fail!(), + ::Bar(3) => panic!(), + ::Bar(_) if false => panic!(), + ::Bar(..) if false => panic!(), ::Bar(n) => assert_eq!(n, 4), - ::Baz => fail!(), + ::Baz => panic!(), } match Other1(Baz) { diff --git a/src/test/run-pass/issue-8351-1.rs b/src/test/run-pass/issue-8351-1.rs index ac389c8e494..c1d5bb0961b 100644 --- a/src/test/run-pass/issue-8351-1.rs +++ b/src/test/run-pass/issue-8351-1.rs @@ -18,8 +18,8 @@ enum E { pub fn main() { let e = Foo{f: 0}; match e { - Foo{f: 1} => fail!(), + Foo{f: 1} => panic!(), Foo{..} => (), - _ => fail!(), + _ => panic!(), } } diff --git a/src/test/run-pass/issue-8351-2.rs b/src/test/run-pass/issue-8351-2.rs index 9ce24200d69..28b37826812 100644 --- a/src/test/run-pass/issue-8351-2.rs +++ b/src/test/run-pass/issue-8351-2.rs @@ -18,8 +18,8 @@ enum E { pub fn main() { let e = Foo{f: 0, b: false}; match e { - Foo{f: 1, b: true} => fail!(), + Foo{f: 1, b: true} => panic!(), Foo{b: false, f: 0} => (), - _ => fail!(), + _ => panic!(), } } diff --git a/src/test/run-pass/last-use-in-block.rs b/src/test/run-pass/last-use-in-block.rs index 05bf8e01c58..c0dcf9e6094 100644 --- a/src/test/run-pass/last-use-in-block.rs +++ b/src/test/run-pass/last-use-in-block.rs @@ -15,7 +15,7 @@ fn lp<T>(s: String, f: |String| -> T) -> T { let r = f(s); return (r); } - fail!(); + panic!(); } fn apply<T>(s: String, f: |String| -> T) -> T { diff --git a/src/test/run-pass/logging-enabled-debug.rs b/src/test/run-pass/logging-enabled-debug.rs index 7975af434d2..4b97d274fba 100644 --- a/src/test/run-pass/logging-enabled-debug.rs +++ b/src/test/run-pass/logging-enabled-debug.rs @@ -17,6 +17,6 @@ extern crate log; pub fn main() { if log_enabled!(log::DEBUG) { - fail!("what?! debugging?"); + panic!("what?! debugging?"); } } diff --git a/src/test/run-pass/logging-enabled.rs b/src/test/run-pass/logging-enabled.rs index 184ac713c89..c4f7b1492ab 100644 --- a/src/test/run-pass/logging-enabled.rs +++ b/src/test/run-pass/logging-enabled.rs @@ -16,9 +16,9 @@ extern crate log; pub fn main() { if log_enabled!(log::DEBUG) { - fail!("what?! debugging?"); + panic!("what?! debugging?"); } if !log_enabled!(log::INFO) { - fail!("what?! no info?"); + panic!("what?! no info?"); } } diff --git a/src/test/run-pass/logging-right-crate.rs b/src/test/run-pass/logging-right-crate.rs index 31c2ae891e0..ced1fdc4455 100644 --- a/src/test/run-pass/logging-right-crate.rs +++ b/src/test/run-pass/logging-right-crate.rs @@ -19,11 +19,11 @@ // monomorphized functions from other crates had logging turned on (their // logging module names were all incorrect). This test ensures that this no // longer happens by enabling logging for *this* crate and then invoking a -// function in an external crate which will fail when logging is enabled. +// function in an external crate which will panic when logging is enabled. extern crate logging_right_crate; pub fn main() { - // this function fails if logging is turned on + // this function panicks if logging is turned on logging_right_crate::foo::<int>(); } diff --git a/src/test/run-pass/loop-no-reinit-needed-post-bot.rs b/src/test/run-pass/loop-no-reinit-needed-post-bot.rs index 14aee4c3be8..0f4dd881698 100644 --- a/src/test/run-pass/loop-no-reinit-needed-post-bot.rs +++ b/src/test/run-pass/loop-no-reinit-needed-post-bot.rs @@ -13,7 +13,7 @@ struct S; impl Drop for S { fn drop(&mut self) { } } // user-defined function "returning" bottom (i.e. no return at all). -fn my_fail() -> ! { loop {} } +fn my_panic() -> ! { loop {} } pub fn step(f: bool) { let mut g = S; @@ -30,7 +30,7 @@ pub fn step(f: bool) { continue; } - my_fail(); + my_panic(); // we never get here, so we do not need to re-initialize g. } diff --git a/src/test/run-pass/macro-interpolation.rs b/src/test/run-pass/macro-interpolation.rs index 76fc05deb0e..672efa68398 100644 --- a/src/test/run-pass/macro-interpolation.rs +++ b/src/test/run-pass/macro-interpolation.rs @@ -18,7 +18,7 @@ macro_rules! overly_complicated ( Some($pat) => { $res } - _ => { fail!(); } + _ => { panic!(); } } }) diff --git a/src/test/run-pass/match-bot-2.rs b/src/test/run-pass/match-bot-2.rs index f3c299bd1f9..5b48d0ff508 100644 --- a/src/test/run-pass/match-bot-2.rs +++ b/src/test/run-pass/match-bot-2.rs @@ -9,5 +9,5 @@ // except according to those terms. // n.b. This was only ever failing with optimization disabled. -fn a() -> int { match return 1i { 2i => 3i, _ => fail!() } } +fn a() -> int { match return 1i { 2i => 3i, _ => panic!() } } pub fn main() { a(); } diff --git a/src/test/run-pass/match-bot.rs b/src/test/run-pass/match-bot.rs index 7e55e227cc0..74cf3faea46 100644 --- a/src/test/run-pass/match-bot.rs +++ b/src/test/run-pass/match-bot.rs @@ -11,6 +11,6 @@ pub fn main() { let i: int = - match Some::<int>(3) { None::<int> => { fail!() } Some::<int>(_) => { 5 } }; + match Some::<int>(3) { None::<int> => { panic!() } Some::<int>(_) => { 5 } }; println!("{}", i); } diff --git a/src/test/run-pass/match-enum-struct-0.rs b/src/test/run-pass/match-enum-struct-0.rs index fef7555af5e..6b18f3c19da 100644 --- a/src/test/run-pass/match-enum-struct-0.rs +++ b/src/test/run-pass/match-enum-struct-0.rs @@ -20,7 +20,7 @@ enum E { pub fn main() { let e = Bar; match e { - Foo{f: _f} => fail!(), + Foo{f: _f} => panic!(), _ => (), } } diff --git a/src/test/run-pass/match-enum-struct-1.rs b/src/test/run-pass/match-enum-struct-1.rs index 12902fb738e..451b8f63e95 100644 --- a/src/test/run-pass/match-enum-struct-1.rs +++ b/src/test/run-pass/match-enum-struct-1.rs @@ -19,10 +19,10 @@ pub fn main() { let e = Foo{f: 1}; match e { Foo{..} => (), - _ => fail!(), + _ => panic!(), } match e { Foo{f: _f} => (), - _ => fail!(), + _ => panic!(), } } diff --git a/src/test/run-pass/match-pattern-lit.rs b/src/test/run-pass/match-pattern-lit.rs index 9d59b197d3a..4265d0a5406 100644 --- a/src/test/run-pass/match-pattern-lit.rs +++ b/src/test/run-pass/match-pattern-lit.rs @@ -14,7 +14,7 @@ fn altlit(f: int) -> int { match f { 10 => { println!("case 10"); return 20; } 11 => { println!("case 11"); return 22; } - _ => fail!("the impossible happened") + _ => panic!("the impossible happened") } } diff --git a/src/test/run-pass/match-pipe-binding.rs b/src/test/run-pass/match-pipe-binding.rs index 2169e996577..ed2f7c5cb47 100644 --- a/src/test/run-pass/match-pipe-binding.rs +++ b/src/test/run-pass/match-pipe-binding.rs @@ -15,7 +15,7 @@ fn test1() { assert_eq!(a, "a".to_string()); assert_eq!(b, "b".to_string()); }, - _ => fail!(), + _ => panic!(), } } @@ -25,7 +25,7 @@ fn test2() { assert_eq!(a, 2); assert_eq!(b, 3); }, - _ => fail!(), + _ => panic!(), } } @@ -35,7 +35,7 @@ fn test3() { assert_eq!(*a, 2); assert_eq!(*b, 3); }, - _ => fail!(), + _ => panic!(), } } @@ -45,7 +45,7 @@ fn test4() { assert_eq!(a, 2); assert_eq!(b, 3); }, - _ => fail!(), + _ => panic!(), } } @@ -55,7 +55,7 @@ fn test5() { assert_eq!(*a, 2); assert_eq!(*b, 3); }, - _ => fail!(), + _ => panic!(), } } diff --git a/src/test/run-pass/match-range.rs b/src/test/run-pass/match-range.rs index 4761d2606fc..83066c126ce 100644 --- a/src/test/run-pass/match-range.rs +++ b/src/test/run-pass/match-range.rs @@ -13,31 +13,31 @@ pub fn main() { match 5u { 1u...5u => {} - _ => fail!("should match range"), + _ => panic!("should match range"), } match 5u { - 6u...7u => fail!("shouldn't match range"), + 6u...7u => panic!("shouldn't match range"), _ => {} } match 5u { - 1u => fail!("should match non-first range"), + 1u => panic!("should match non-first range"), 2u...6u => {} - _ => fail!("math is broken") + _ => panic!("math is broken") } match 'c' { 'a'...'z' => {} - _ => fail!("should suppport char ranges") + _ => panic!("should suppport char ranges") } match -3i { -7...5 => {} - _ => fail!("should match signed range") + _ => panic!("should match signed range") } match 3.0f64 { 1.0...5.0 => {} - _ => fail!("should match float range") + _ => panic!("should match float range") } match -1.5f64 { -3.6...3.6 => {} - _ => fail!("should match negative float range") + _ => panic!("should match negative float range") } } diff --git a/src/test/run-pass/match-ref-binding-in-guard-3256.rs b/src/test/run-pass/match-ref-binding-in-guard-3256.rs index a07c63490e7..243c87c0eeb 100644 --- a/src/test/run-pass/match-ref-binding-in-guard-3256.rs +++ b/src/test/run-pass/match-ref-binding-in-guard-3256.rs @@ -15,7 +15,7 @@ pub fn main() { Some(ref z) if *z.lock() => { assert!(*z.lock()); }, - _ => fail!() + _ => panic!() } } } diff --git a/src/test/run-pass/match-str.rs b/src/test/run-pass/match-str.rs index d31f7a60715..651f56e894a 100644 --- a/src/test/run-pass/match-str.rs +++ b/src/test/run-pass/match-str.rs @@ -11,21 +11,21 @@ // Issue #53 pub fn main() { - match "test" { "not-test" => fail!(), "test" => (), _ => fail!() } + match "test" { "not-test" => panic!(), "test" => (), _ => panic!() } enum t { tag1(String), tag2, } match tag1("test".to_string()) { - tag2 => fail!(), - tag1(ref s) if "test" != s.as_slice() => fail!(), + tag2 => panic!(), + tag1(ref s) if "test" != s.as_slice() => panic!(), tag1(ref s) if "test" == s.as_slice() => (), - _ => fail!() + _ => panic!() } - let x = match "a" { "a" => 1i, "b" => 2i, _ => fail!() }; + let x = match "a" { "a" => 1i, "b" => 2i, _ => panic!() }; assert_eq!(x, 1); - match "a" { "a" => { } "b" => { }, _ => fail!() } + match "a" { "a" => { } "b" => { }, _ => panic!() } } diff --git a/src/test/run-pass/match-struct-0.rs b/src/test/run-pass/match-struct-0.rs index 769a5ab5460..6d5658aa13c 100644 --- a/src/test/run-pass/match-struct-0.rs +++ b/src/test/run-pass/match-struct-0.rs @@ -15,15 +15,15 @@ struct Foo{ pub fn main() { let f = Foo{f: 1}; match f { - Foo{f: 0} => fail!(), + Foo{f: 0} => panic!(), Foo{..} => (), } match f { - Foo{f: 0} => fail!(), + Foo{f: 0} => panic!(), Foo{f: _f} => (), } match f { - Foo{f: 0} => fail!(), + Foo{f: 0} => panic!(), _ => (), } } diff --git a/src/test/run-pass/negative.rs b/src/test/run-pass/negative.rs index 148c1c9f0cf..4bf91bf7035 100644 --- a/src/test/run-pass/negative.rs +++ b/src/test/run-pass/negative.rs @@ -11,6 +11,6 @@ pub fn main() { match -5i { -5 => {} - _ => { fail!() } + _ => { panic!() } } } diff --git a/src/test/run-pass/nested-block-comment.rs b/src/test/run-pass/nested-block-comment.rs index 0cbe46cb4ef..a6d932935ad 100644 --- a/src/test/run-pass/nested-block-comment.rs +++ b/src/test/run-pass/nested-block-comment.rs @@ -11,7 +11,7 @@ /* This test checks that nested comments are supported /* - This should not fail + This should not panic */ */ diff --git a/src/test/run-pass/nested-class.rs b/src/test/run-pass/nested-class.rs index 927f8160f7e..19eba0808c8 100644 --- a/src/test/run-pass/nested-class.rs +++ b/src/test/run-pass/nested-class.rs @@ -23,7 +23,7 @@ pub fn main() { } } - // fn b(x:int) -> int { fail!(); } + // fn b(x:int) -> int { panic!(); } let z = b(42); assert_eq!(z.i, 42); diff --git a/src/test/run-pass/nested-matchs.rs b/src/test/run-pass/nested-matchs.rs index fa28025afa0..55c1de2700f 100644 --- a/src/test/run-pass/nested-matchs.rs +++ b/src/test/run-pass/nested-matchs.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn baz() -> ! { fail!(); } +fn baz() -> ! { panic!(); } fn foo() { match Some::<int>(5) { diff --git a/src/test/run-pass/nested-pattern.rs b/src/test/run-pass/nested-pattern.rs index bc03b0d27ca..7fe50d66708 100644 --- a/src/test/run-pass/nested-pattern.rs +++ b/src/test/run-pass/nested-pattern.rs @@ -16,7 +16,7 @@ enum t { foo(int, uint), bar(int, Option<int>), } fn nested(o: t) { match o { - bar(_i, Some::<int>(_)) => { println!("wrong pattern matched"); fail!(); } + bar(_i, Some::<int>(_)) => { println!("wrong pattern matched"); panic!(); } _ => { println!("succeeded"); } } } diff --git a/src/test/run-pass/no-landing-pads.rs b/src/test/run-pass/no-landing-pads.rs index bc7987f4a27..eda36fad215 100644 --- a/src/test/run-pass/no-landing-pads.rs +++ b/src/test/run-pass/no-landing-pads.rs @@ -25,7 +25,7 @@ impl Drop for A { fn main() { task::try::<()>(proc() { let _a = A; - fail!(); + panic!(); }); assert!(unsafe { !HIT }); } diff --git a/src/test/run-pass/nullable-pointer-iotareduction.rs b/src/test/run-pass/nullable-pointer-iotareduction.rs index 9d7130ecb8c..450034e1240 100644 --- a/src/test/run-pass/nullable-pointer-iotareduction.rs +++ b/src/test/run-pass/nullable-pointer-iotareduction.rs @@ -30,7 +30,7 @@ impl<T> E<T> { } fn get_ref(&self) -> (int, &T) { match *self { - Nothing(..) => fail!("E::get_ref(Nothing::<{}>)", stringify!(T)), + Nothing(..) => panic!("E::get_ref(Nothing::<{}>)", stringify!(T)), Thing(x, ref y) => (x, y) } } @@ -59,7 +59,7 @@ macro_rules! check_fancy { let t_ = Thing::<$T>(23, e); match t_.get_ref() { (23, $v) => { $chk } - _ => fail!("Thing::<{}>(23, {}).get_ref() != (23, _)", + _ => panic!("Thing::<{}>(23, {}).get_ref() != (23, _)", stringify!($T), stringify!($e)) } }} diff --git a/src/test/run-pass/option-unwrap.rs b/src/test/run-pass/option-unwrap.rs index 8bdae89e523..71323016e83 100644 --- a/src/test/run-pass/option-unwrap.rs +++ b/src/test/run-pass/option-unwrap.rs @@ -26,7 +26,7 @@ impl<'a> Drop for dtor<'a> { fn unwrap<T>(o: Option<T>) -> T { match o { Some(v) => v, - None => fail!() + None => panic!() } } diff --git a/src/test/run-pass/overload-index-operator.rs b/src/test/run-pass/overload-index-operator.rs index d047f02fe2f..7c6ad45a9ef 100644 --- a/src/test/run-pass/overload-index-operator.rs +++ b/src/test/run-pass/overload-index-operator.rs @@ -35,7 +35,7 @@ impl<K: PartialEq + std::fmt::Show, V:Clone> Index<K,V> for AssociationList<K,V> return &pair.value } } - fail!("No value found for key: {}", index); + panic!("No value found for key: {}", index); } } diff --git a/src/test/run-pass/overloaded-autoderef.rs b/src/test/run-pass/overloaded-autoderef.rs index a0686e7f17f..2975b209d06 100644 --- a/src/test/run-pass/overloaded-autoderef.rs +++ b/src/test/run-pass/overloaded-autoderef.rs @@ -36,7 +36,7 @@ pub fn main() { let mut_s = Rc::new(RefCell::new(String::from_str("foo"))); mut_s.borrow_mut().push_str("bar"); - // HACK assert_eq! would fail here because it stores the LHS and RHS in two locals. + // HACK assert_eq! would panic here because it stores the LHS and RHS in two locals. assert!(mut_s.borrow().as_slice() == "foobar"); assert!(mut_s.borrow_mut().as_slice() == "foobar"); diff --git a/src/test/run-pass/overloaded-deref.rs b/src/test/run-pass/overloaded-deref.rs index cdd56f64d27..b63db29cf91 100644 --- a/src/test/run-pass/overloaded-deref.rs +++ b/src/test/run-pass/overloaded-deref.rs @@ -34,7 +34,7 @@ pub fn main() { let mut_s = Rc::new(RefCell::new(String::from_str("foo"))); (*(*mut_s).borrow_mut()).push_str("bar"); - // assert_eq! would fail here because it stores the LHS and RHS in two locals. + // assert_eq! would panic here because it stores the LHS and RHS in two locals. assert!((*(*mut_s).borrow()).as_slice() == "foobar"); assert!((*(*mut_s).borrow_mut()).as_slice() == "foobar"); diff --git a/src/test/run-pass/parse-fail.rs b/src/test/run-pass/parse-fail.rs index 34c5bf0234f..0dbba3654b6 100644 --- a/src/test/run-pass/parse-fail.rs +++ b/src/test/run-pass/parse-fail.rs @@ -10,6 +10,6 @@ #![allow(unreachable_code)] -fn dont_call_me() { fail!(); println!("{}", 1i); } +fn dont_call_me() { panic!(); println!("{}", 1i); } pub fn main() { } diff --git a/src/test/run-pass/process-detach.rs b/src/test/run-pass/process-detach.rs index 569d4acb4c6..4c078a66f08 100644 --- a/src/test/run-pass/process-detach.rs +++ b/src/test/run-pass/process-detach.rs @@ -44,6 +44,6 @@ fn main() { drop(p.stdin.take()); match p.wait().unwrap() { process::ExitStatus(..) => {} - process::ExitSignal(..) => fail!() + process::ExitSignal(..) => panic!() } } diff --git a/src/test/run-pass/regions-bot.rs b/src/test/run-pass/regions-bot.rs index dbc5bf6626a..75c52f63041 100644 --- a/src/test/run-pass/regions-bot.rs +++ b/src/test/run-pass/regions-bot.rs @@ -10,7 +10,7 @@ // A very limited test of the "bottom" region -fn produce_static<T>() -> &'static T { fail!(); } +fn produce_static<T>() -> &'static T { panic!(); } fn foo<T>(_x: &T) -> &uint { produce_static() } diff --git a/src/test/run-pass/regions-dependent-addr-of.rs b/src/test/run-pass/regions-dependent-addr-of.rs index 68a451b62ac..f074ca9a889 100644 --- a/src/test/run-pass/regions-dependent-addr-of.rs +++ b/src/test/run-pass/regions-dependent-addr-of.rs @@ -58,21 +58,21 @@ fn get_v5(a: &A, _i: uint) -> &int { fn get_v6_a(a: &A, _i: uint) -> &int { match a.value.v6 { Some(ref v) => &v.f, - None => fail!() + None => panic!() } } fn get_v6_b(a: &A, _i: uint) -> &int { match *a { A { value: B { v6: Some(ref v), .. } } => &v.f, - _ => fail!() + _ => panic!() } } fn get_v6_c(a: &A, _i: uint) -> &int { match a { &A { value: B { v6: Some(ref v), .. } } => &v.f, - _ => fail!() + _ => panic!() } } diff --git a/src/test/run-pass/regions-early-bound-trait-param.rs b/src/test/run-pass/regions-early-bound-trait-param.rs index c732d20a156..5de5e39a454 100644 --- a/src/test/run-pass/regions-early-bound-trait-param.rs +++ b/src/test/run-pass/regions-early-bound-trait-param.rs @@ -91,13 +91,13 @@ impl<'l> List<'l> { fn car<'m>(&'m self) -> int { match self { &Cons(car, _) => car, - &Null => fail!(), + &Null => panic!(), } } fn cdr<'n>(&'n self) -> &'l List<'l> { match self { &Cons(_, cdr) => cdr, - &Null => fail!(), + &Null => panic!(), } } } diff --git a/src/test/run-pass/regions-return-interior-of-option.rs b/src/test/run-pass/regions-return-interior-of-option.rs index f6971a8b4ad..54458f0d0df 100644 --- a/src/test/run-pass/regions-return-interior-of-option.rs +++ b/src/test/run-pass/regions-return-interior-of-option.rs @@ -11,7 +11,7 @@ fn get<T>(opt: &Option<T>) -> &T { match *opt { Some(ref v) => v, - None => fail!("none") + None => panic!("none") } } diff --git a/src/test/run-pass/ret-bang.rs b/src/test/run-pass/ret-bang.rs index 42e5c8731e2..ff4932e8453 100644 --- a/src/test/run-pass/ret-bang.rs +++ b/src/test/run-pass/ret-bang.rs @@ -11,7 +11,7 @@ -fn my_err(s: String) -> ! { println!("{}", s); fail!(); } +fn my_err(s: String) -> ! { println!("{}", s); panic!(); } fn okay(i: uint) -> int { if i == 3u { diff --git a/src/test/run-pass/return-from-closure.rs b/src/test/run-pass/return-from-closure.rs index 1756d74a81e..2709904fb4c 100644 --- a/src/test/run-pass/return-from-closure.rs +++ b/src/test/run-pass/return-from-closure.rs @@ -17,7 +17,7 @@ fn surrounding() { unsafe { calls += 1 } if n >= 0 { return; } - fail!() + panic!() }; return_works(10); @@ -28,7 +28,7 @@ fn surrounding() { unsafe { calls += 1 } if n >= 0 { return; } - fail!() + panic!() }; return_works_proc(10); diff --git a/src/test/run-pass/running-with-no-runtime.rs b/src/test/run-pass/running-with-no-runtime.rs index d0762d1f3d8..942542a6bcd 100644 --- a/src/test/run-pass/running-with-no-runtime.rs +++ b/src/test/run-pass/running-with-no-runtime.rs @@ -25,12 +25,12 @@ fn start(argc: int, argv: *const *const u8) -> int { 1 => {} 2 => println!("foo"), 3 => assert!(try(|| {}).is_ok()), - 4 => assert!(try(|| fail!()).is_err()), + 4 => assert!(try(|| panic!()).is_err()), 5 => assert!(try(|| spawn(proc() {})).is_err()), 6 => assert!(Command::new("test").spawn().is_err()), 7 => assert!(foo.get().is_none()), 8 => assert!(try(|| { foo.replace(Some(3)); }).is_err()), - _ => fail!() + _ => panic!() } } return 0 diff --git a/src/test/run-pass/sepcomp-unwind.rs b/src/test/run-pass/sepcomp-unwind.rs index 5d154e02af6..c2c7a48815c 100644 --- a/src/test/run-pass/sepcomp-unwind.rs +++ b/src/test/run-pass/sepcomp-unwind.rs @@ -23,7 +23,7 @@ fn pad() -> uint { 0 } mod a { pub fn f() { - fail!(); + panic!(); } } diff --git a/src/test/run-pass/signal-exit-status.rs b/src/test/run-pass/signal-exit-status.rs index 52fa8e1132e..dc72b6b0539 100644 --- a/src/test/run-pass/signal-exit-status.rs +++ b/src/test/run-pass/signal-exit-status.rs @@ -25,7 +25,7 @@ pub fn main() { match status { ExitSignal(_) if cfg!(unix) => {}, ExitStatus(0xC0000028) if cfg!(windows) => {}, - _ => fail!("invalid termination (was not signalled): {}", status) + _ => panic!("invalid termination (was not signalled): {}", status) } } } diff --git a/src/test/run-pass/size-and-align.rs b/src/test/run-pass/size-and-align.rs index 65928fd7bf3..afb6c21d3f4 100644 --- a/src/test/run-pass/size-and-align.rs +++ b/src/test/run-pass/size-and-align.rs @@ -15,7 +15,7 @@ fn uhoh<T>(v: Vec<clam<T>> ) { a::<T>(ref _t, ref u) => { println!("incorrect"); println!("{}", u); - fail!(); + panic!(); } b::<T> => { println!("correct"); } } diff --git a/src/test/run-pass/slice-fail-2.rs b/src/test/run-pass/slice-fail-2.rs index a2aecc1d5cd..0ac7a2001fc 100644 --- a/src/test/run-pass/slice-fail-2.rs +++ b/src/test/run-pass/slice-fail-2.rs @@ -23,7 +23,7 @@ impl Drop for Foo { } fn bar() -> uint { - fail!(); + panic!(); } fn foo() { diff --git a/src/test/run-pass/smallest-hello-world.rs b/src/test/run-pass/smallest-hello-world.rs index 65307c5e7b5..2877aa6bd3b 100644 --- a/src/test/run-pass/smallest-hello-world.rs +++ b/src/test/run-pass/smallest-hello-world.rs @@ -22,7 +22,7 @@ extern "rust-intrinsic" { fn transmute<T, U>(t: T) -> U; } #[lang = "stack_exhausted"] extern fn stack_exhausted() {} #[lang = "eh_personality"] extern fn eh_personality() {} -#[lang = "fail_fmt"] fn fail_fmt() -> ! { loop {} } +#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} } #[start] #[no_stack_check] diff --git a/src/test/run-pass/syntax-extension-cfg.rs b/src/test/run-pass/syntax-extension-cfg.rs index 8f67532d89d..8c888ff0362 100644 --- a/src/test/run-pass/syntax-extension-cfg.rs +++ b/src/test/run-pass/syntax-extension-cfg.rs @@ -12,21 +12,21 @@ pub fn main() { // check - if ! cfg!(foo) { fail!() } - if cfg!(not(foo)) { fail!() } + if ! cfg!(foo) { panic!() } + if cfg!(not(foo)) { panic!() } - if ! cfg!(qux="foo") { fail!() } - if cfg!(not(qux="foo")) { fail!() } + if ! cfg!(qux="foo") { panic!() } + if cfg!(not(qux="foo")) { panic!() } - if ! cfg!(all(foo, qux="foo")) { fail!() } - if cfg!(not(all(foo, qux="foo"))) { fail!() } - if cfg!(all(not(all(foo, qux="foo")))) { fail!() } + if ! cfg!(all(foo, qux="foo")) { panic!() } + if cfg!(not(all(foo, qux="foo"))) { panic!() } + if cfg!(all(not(all(foo, qux="foo")))) { panic!() } - if cfg!(not_a_cfg) { fail!() } - if cfg!(all(not_a_cfg, foo, qux="foo")) { fail!() } - if cfg!(all(not_a_cfg, foo, qux="foo")) { fail!() } - if ! cfg!(any(not_a_cfg, foo)) { fail!() } + if cfg!(not_a_cfg) { panic!() } + if cfg!(all(not_a_cfg, foo, qux="foo")) { panic!() } + if cfg!(all(not_a_cfg, foo, qux="foo")) { panic!() } + if ! cfg!(any(not_a_cfg, foo)) { panic!() } - if ! cfg!(not(not_a_cfg)) { fail!() } - if ! cfg!(all(not(not_a_cfg), foo, qux="foo")) { fail!() } + if ! cfg!(not(not_a_cfg)) { panic!() } + if ! cfg!(all(not(not_a_cfg), foo, qux="foo")) { panic!() } } diff --git a/src/test/run-pass/task-stderr.rs b/src/test/run-pass/task-stderr.rs index ceffd1e3636..0dbe74d722b 100644 --- a/src/test/run-pass/task-stderr.rs +++ b/src/test/run-pass/task-stderr.rs @@ -17,7 +17,7 @@ fn main() { let stderr = ChanWriter::new(tx); let res = TaskBuilder::new().stderr(box stderr as Box<Writer + Send>).try(proc() -> () { - fail!("Hello, world!") + panic!("Hello, world!") }); assert!(res.is_err()); diff --git a/src/test/run-pass/tcp-accept-stress.rs b/src/test/run-pass/tcp-accept-stress.rs index fe882937ca0..bf6fe5a9d26 100644 --- a/src/test/run-pass/tcp-accept-stress.rs +++ b/src/test/run-pass/tcp-accept-stress.rs @@ -45,7 +45,7 @@ fn test() { } } Err(ref e) if e.kind == EndOfFile => break, - Err(e) => fail!("{}", e), + Err(e) => panic!("{}", e), } } srv_tx.send(()); @@ -67,7 +67,7 @@ fn test() { // wait for senders if cli_rx.iter().take(N).count() != N { a.close_accept().unwrap(); - fail!("clients failed"); + panic!("clients panicked"); } // wait for one acceptor to die diff --git a/src/test/run-pass/tcp-connect-timeouts.rs b/src/test/run-pass/tcp-connect-timeouts.rs index e186f63e0a4..07fc1212d78 100644 --- a/src/test/run-pass/tcp-connect-timeouts.rs +++ b/src/test/run-pass/tcp-connect-timeouts.rs @@ -48,10 +48,10 @@ fn eventual_timeout() { match TcpStream::connect_timeout(addr, Duration::milliseconds(100)) { Ok(e) => v.push(e), Err(ref e) if e.kind == io::TimedOut => return, - Err(e) => fail!("other error: {}", e), + Err(e) => panic!("other error: {}", e), } } - fail!("never timed out!"); + panic!("never timed out!"); } fn timeout_success() { diff --git a/src/test/run-pass/tcp-stress.rs b/src/test/run-pass/tcp-stress.rs index 91c07c259a2..8d2a8a6ccfe 100644 --- a/src/test/run-pass/tcp-stress.rs +++ b/src/test/run-pass/tcp-stress.rs @@ -40,7 +40,7 @@ fn main() { let mut stream = match acceptor.accept() { Ok(stream) => stream, Err(error) => { - debug!("accept failed: {}", error); + debug!("accept panicked: {}", error); continue; } }; diff --git a/src/test/run-pass/tempfile.rs b/src/test/run-pass/tempfile.rs index eceafa40265..476278405ca 100644 --- a/src/test/run-pass/tempfile.rs +++ b/src/test/run-pass/tempfile.rs @@ -39,7 +39,7 @@ fn test_rm_tempdir() { let f: proc():Send = proc() { let tmp = TempDir::new("test_rm_tempdir").unwrap(); tx.send(tmp.path().clone()); - fail!("fail to unwind past `tmp`"); + panic!("panic to unwind past `tmp`"); }; task::try(f); let path = rx.recv(); @@ -49,7 +49,7 @@ fn test_rm_tempdir() { let path = tmp.path().clone(); let f: proc():Send = proc() { let _tmp = tmp; - fail!("fail to unwind past `tmp`"); + panic!("panic to unwind past `tmp`"); }; task::try(f); assert!(!path.exists()); @@ -81,7 +81,7 @@ fn test_rm_tempdir_close() { let tmp = TempDir::new("test_rm_tempdir").unwrap(); tx.send(tmp.path().clone()); tmp.close(); - fail!("fail to unwind past `tmp`"); + panic!("panic when unwinding past `tmp`"); }; task::try(f); let path = rx.recv(); @@ -92,7 +92,7 @@ fn test_rm_tempdir_close() { let f: proc():Send = proc() { let tmp = tmp; tmp.close(); - fail!("fail to unwind past `tmp`"); + panic!("panic when unwinding past `tmp`"); }; task::try(f); assert!(!path.exists()); @@ -175,15 +175,15 @@ pub fn test_rmdir_recursive_ok() { assert!(!root.join("bar").join("blat").exists()); } -pub fn dont_double_fail() { +pub fn dont_double_panic() { let r: Result<(), _> = task::try(proc() { let tmpdir = TempDir::new("test").unwrap(); // Remove the temporary directory so that TempDir sees // an error on drop fs::rmdir(tmpdir.path()); - // Trigger failure. If TempDir fails *again* due to the rmdir + // Panic. If TempDir panics *again* due to the rmdir // error then the process will abort. - fail!(); + panic!(); }); assert!(r.is_err()); } @@ -203,5 +203,5 @@ pub fn main() { in_tmpdir(recursive_mkdir_dot); in_tmpdir(recursive_mkdir_rel_2); in_tmpdir(test_rmdir_recursive_ok); - in_tmpdir(dont_double_fail); + in_tmpdir(dont_double_panic); } diff --git a/src/test/run-pass/terminate-in-initializer.rs b/src/test/run-pass/terminate-in-initializer.rs index 41a9e6e53f2..2a71148216d 100644 --- a/src/test/run-pass/terminate-in-initializer.rs +++ b/src/test/run-pass/terminate-in-initializer.rs @@ -20,13 +20,13 @@ fn test_cont() { let mut i = 0i; while i < 1 { i += 1; let _x: Box<int> = contin fn test_ret() { let _x: Box<int> = return; } -fn test_fail() { - fn f() { let _x: Box<int> = fail!(); } +fn test_panic() { + fn f() { let _x: Box<int> = panic!(); } task::try(proc() f() ); } -fn test_fail_indirect() { - fn f() -> ! { fail!(); } +fn test_panic_indirect() { + fn f() -> ! { panic!(); } fn g() { let _x: Box<int> = f(); } task::try(proc() g() ); } @@ -35,6 +35,6 @@ pub fn main() { test_break(); test_cont(); test_ret(); - test_fail(); - test_fail_indirect(); + test_panic(); + test_panic_indirect(); } diff --git a/src/test/run-pass/test-runner-hides-main.rs b/src/test/run-pass/test-runner-hides-main.rs index 9b658ee1dae..839e91f3793 100644 --- a/src/test/run-pass/test-runner-hides-main.rs +++ b/src/test/run-pass/test-runner-hides-main.rs @@ -13,4 +13,4 @@ // Building as a test runner means that a synthetic main will be run, // not ours -pub fn main() { fail!(); } +pub fn main() { panic!(); } diff --git a/src/test/run-pass/trans-tag-static-padding.rs b/src/test/run-pass/trans-tag-static-padding.rs index ed4712ff3be..93aa367feee 100644 --- a/src/test/run-pass/trans-tag-static-padding.rs +++ b/src/test/run-pass/trans-tag-static-padding.rs @@ -57,10 +57,10 @@ fn non_default_instance() -> &'static Request { pub fn main() { match default_instance() { &Request { foo: TestNone, bar: 17 } => {}, - _ => fail!(), + _ => panic!(), }; match non_default_instance() { &Request { foo: TestSome(0x1020304050607080), bar: 19 } => {}, - _ => fail!(), + _ => panic!(), }; } diff --git a/src/test/run-pass/typeck-macro-interaction-issue-8852.rs b/src/test/run-pass/typeck-macro-interaction-issue-8852.rs index 6be79cb62dd..48d073e28aa 100644 --- a/src/test/run-pass/typeck-macro-interaction-issue-8852.rs +++ b/src/test/run-pass/typeck-macro-interaction-issue-8852.rs @@ -26,7 +26,7 @@ macro_rules! test( match (a, b) { (A($id1), A($id2)) => A($e), (B($id1), B($id2)) => B($e), - _ => fail!() + _ => panic!() } } ) diff --git a/src/test/run-pass/unique-containing-tag.rs b/src/test/run-pass/unique-containing-tag.rs index 762a74b2455..3c67eaee0a6 100644 --- a/src/test/run-pass/unique-containing-tag.rs +++ b/src/test/run-pass/unique-containing-tag.rs @@ -17,13 +17,13 @@ pub fn main() { t1(a) { assert_eq!(a, 10); } - _ { fail!(); } + _ { panic!(); } }*/ /*alt x { box t1(a) { assert_eq!(a, 10); } - _ { fail!(); } + _ { panic!(); } }*/ } diff --git a/src/test/run-pass/unique-decl.rs b/src/test/run-pass/unique-decl.rs index 7f894a8c324..a902fef288f 100644 --- a/src/test/run-pass/unique-decl.rs +++ b/src/test/run-pass/unique-decl.rs @@ -14,5 +14,5 @@ pub fn main() { } fn f(_i: Box<int>) -> Box<int> { - fail!(); + panic!(); } diff --git a/src/test/run-pass/unique-pat.rs b/src/test/run-pass/unique-pat.rs index 297ded0222d..a0eee7e3cb6 100644 --- a/src/test/run-pass/unique-pat.rs +++ b/src/test/run-pass/unique-pat.rs @@ -11,7 +11,7 @@ fn simple() { match box true { box true => { } - _ => { fail!(); } + _ => { panic!(); } } } diff --git a/src/test/run-pass/unit-like-struct-drop-run.rs b/src/test/run-pass/unit-like-struct-drop-run.rs index 3a1cc0331a3..c12303b009f 100644 --- a/src/test/run-pass/unit-like-struct-drop-run.rs +++ b/src/test/run-pass/unit-like-struct-drop-run.rs @@ -17,7 +17,7 @@ struct Foo; impl Drop for Foo { fn drop(&mut self) { - fail!("This failure should happen."); + panic!("This panic should happen."); } } @@ -27,5 +27,5 @@ pub fn main() { }); let s = x.unwrap_err().downcast::<&'static str>().unwrap(); - assert_eq!(s.as_slice(), "This failure should happen."); + assert_eq!(s.as_slice(), "This panic should happen."); } diff --git a/src/test/run-pass/unix-process-spawn-errno.rs b/src/test/run-pass/unix-process-spawn-errno.rs index 42b78e4ec66..b2ef1a044db 100644 --- a/src/test/run-pass/unix-process-spawn-errno.rs +++ b/src/test/run-pass/unix-process-spawn-errno.rs @@ -87,7 +87,7 @@ fn main() { }; match process::Process::spawn(cfg) { - Ok(_) => { fail!("spawn() should have failled"); } + Ok(_) => { panic!("spawn() should have panicked"); } Err(rtio::IoError { code: err, ..}) => { assert_eq!(err as c_int, EXPECTED_ERRNO); } diff --git a/src/test/run-pass/unreachable-code-1.rs b/src/test/run-pass/unreachable-code-1.rs index fa24cc44f90..d8a8913e58a 100644 --- a/src/test/run-pass/unreachable-code-1.rs +++ b/src/test/run-pass/unreachable-code-1.rs @@ -14,7 +14,7 @@ fn id(x: bool) -> bool { x } fn call_id() { - let c = fail!(); + let c = panic!(); id(c); //~ WARNING unreachable statement } diff --git a/src/test/run-pass/unreachable-code.rs b/src/test/run-pass/unreachable-code.rs index 496be7e0e6a..a9ac78c5d76 100644 --- a/src/test/run-pass/unreachable-code.rs +++ b/src/test/run-pass/unreachable-code.rs @@ -15,7 +15,7 @@ fn id(x: bool) -> bool { x } fn call_id() { - let c = fail!(); + let c = panic!(); id(c); } diff --git a/src/test/run-pass/unwind-resource.rs b/src/test/run-pass/unwind-resource.rs index 13370ea340f..60f07663bef 100644 --- a/src/test/run-pass/unwind-resource.rs +++ b/src/test/run-pass/unwind-resource.rs @@ -32,7 +32,7 @@ fn complainer(tx: Sender<bool>) -> complainer { fn f(tx: Sender<bool>) { let _tx = complainer(tx); - fail!(); + panic!(); } pub fn main() { diff --git a/src/test/run-pass/unwind-unique.rs b/src/test/run-pass/unwind-unique.rs index e5497427755..2f31ee25b5d 100644 --- a/src/test/run-pass/unwind-unique.rs +++ b/src/test/run-pass/unwind-unique.rs @@ -12,7 +12,7 @@ use std::task; fn f() { let _a = box 0i; - fail!(); + panic!(); } pub fn main() { diff --git a/src/test/run-pass/use-uninit-match2.rs b/src/test/run-pass/use-uninit-match2.rs index b5d2b9ef84c..9337d064d23 100644 --- a/src/test/run-pass/use-uninit-match2.rs +++ b/src/test/run-pass/use-uninit-match2.rs @@ -13,7 +13,7 @@ fn foo<T>(o: myoption<T>) -> int { let mut x: int; match o { - none::<T> => { fail!(); } + none::<T> => { panic!(); } some::<T>(_t) => { x = 5; } } return x; diff --git a/src/test/run-pass/vec-matching-autoslice.rs b/src/test/run-pass/vec-matching-autoslice.rs index 9992c059ac4..6476f734ae6 100644 --- a/src/test/run-pass/vec-matching-autoslice.rs +++ b/src/test/run-pass/vec-matching-autoslice.rs @@ -11,11 +11,11 @@ pub fn main() { let x = [1i, 2, 3]; match x { - [2, _, _] => fail!(), + [2, _, _] => panic!(), [1, a, b] => { assert!([a, b] == [2, 3]); } - [_, _, _] => fail!(), + [_, _, _] => panic!(), } let y = ([(1i, true), (2i, false)], 0.5f64); @@ -24,7 +24,7 @@ pub fn main() { assert_eq!(a, true); assert_eq!(b, 2); } - ([_, _], 0.5) => fail!(), - ([_, _], _) => fail!(), + ([_, _], 0.5) => panic!(), + ([_, _], _) => panic!(), } } diff --git a/src/test/run-pass/vec-matching.rs b/src/test/run-pass/vec-matching.rs index 187d97f483d..77226df7fa2 100644 --- a/src/test/run-pass/vec-matching.rs +++ b/src/test/run-pass/vec-matching.rs @@ -57,7 +57,7 @@ fn b() { fn c() { let x = [1i]; match x { - [2, ..] => fail!(), + [2, ..] => panic!(), [..] => () } } diff --git a/src/test/run-pass/vector-sort-failure-safe.rs b/src/test/run-pass/vector-sort-failure-safe.rs index 10c37651a86..ce9cc68bd36 100644 --- a/src/test/run-pass/vector-sort-failure-safe.rs +++ b/src/test/run-pass/vector-sort-failure-safe.rs @@ -68,8 +68,8 @@ pub fn main() { let mut count = 0; main.clone().as_mut_slice().sort_by(|a, b| { count += 1; a.cmp(b) }); - // ... and then fail on each and every single one. - for fail_countdown in range(0i, count) { + // ... and then panic on each and every single one. + for panic_countdown in range(0i, count) { // refresh the counters. for c in drop_counts.iter() { c.store(0, Relaxed); @@ -79,12 +79,12 @@ pub fn main() { let _ = task::try(proc() { let mut v = v; - let mut fail_countdown = fail_countdown; + let mut panic_countdown = panic_countdown; v.as_mut_slice().sort_by(|a, b| { - if fail_countdown == 0 { - fail!() + if panic_countdown == 0 { + panic!() } - fail_countdown -= 1; + panic_countdown -= 1; a.cmp(b) }) }); diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs index 72204c28f82..f73800b89db 100644 --- a/src/test/run-pass/weird-exprs.rs +++ b/src/test/run-pass/weird-exprs.rs @@ -71,7 +71,7 @@ fn canttouchthis() -> uint { fn angrydome() { loop { if break { } } let mut i = 0i; - loop { i += 1; if i == 1 { match (continue) { 1i => { }, _ => fail!("wat") } } + loop { i += 1; if i == 1 { match (continue) { 1i => { }, _ => panic!("wat") } } break; } } diff --git a/src/test/run-pass/while-label.rs b/src/test/run-pass/while-label.rs index dd53ac889f5..41712f7c64d 100644 --- a/src/test/run-pass/while-label.rs +++ b/src/test/run-pass/while-label.rs @@ -15,7 +15,7 @@ pub fn main() { i -= 1; if i == 95 { break 'w; - fail!("Should have broken out of loop"); + panic!("Should have broken out of loop"); } } assert_eq!(i, 95); diff --git a/src/test/run-pass/writealias.rs b/src/test/run-pass/writealias.rs index 6d57bff1bd6..ae49c07093b 100644 --- a/src/test/run-pass/writealias.rs +++ b/src/test/run-pass/writealias.rs @@ -20,7 +20,7 @@ pub fn main() { Some(ref z) if *z.lock() => { assert!(*z.lock()); }, - _ => fail!() + _ => panic!() } } } |
