From 6ac7fc73f5acfe30c698ea4f8bfc37b30473977e Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Tue, 28 Oct 2014 14:07:33 -0400 Subject: [PATCH] Update infrastructure for fail -> panic This includes updating the language items and marking what needs to change after a snapshot. If you do not use the standard library, the language items you need to implement have changed. For example: ```rust #[lang = "fail_fmt"] fn fail_fmt() -> ! { loop {} } ``` is now ```rust #[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} } ``` Related, lesser-implemented language items `fail` and `fail_bounds_check` have become `panic` and `panic_bounds_check`, as well. These are implemented by `libcore`, so it is unlikely (though possible!) that these two renamings will affect you. [breaking-change] Fix test suite --- src/doc/guide-unsafe.md | 18 +++---- src/libcore/panicking.rs | 47 +++++++++++++++++++ src/librustc/middle/trans/controlflow.rs | 6 +-- src/librustrt/unwind.rs | 8 ++++ src/test/auxiliary/lang-item-public.rs | 4 +- src/test/compile-fail/binop-fail-3.rs | 2 +- src/test/compile-fail/issue-5500.rs | 2 +- src/test/compile-fail/weak-lang-item.rs | 2 +- src/test/run-fail/assert-macro-explicit.rs | 2 +- src/test/run-fail/assert-macro-fmt.rs | 2 +- src/test/run-fail/assert-macro-owned.rs | 2 +- src/test/run-fail/assert-macro-static.rs | 2 +- .../run-fail/by-value-self-objects-fail.rs | 2 +- src/test/run-fail/expr-fn-fail.rs | 4 +- src/test/run-fail/expr-if-fail-fn.rs | 4 +- src/test/run-fail/expr-if-fail.rs | 4 +- src/test/run-fail/expr-match-fail-fn.rs | 4 +- src/test/run-fail/expr-match-fail.rs | 4 +- src/test/run-fail/fail-macro-any-wrapped.rs | 2 +- src/test/run-fail/fail-macro-any.rs | 3 +- src/test/run-fail/fail-macro-explicit.rs | 2 +- src/test/run-fail/fail-macro-fmt.rs | 2 +- src/test/run-fail/fail-macro-owned.rs | 2 +- src/test/run-fail/fail-macro-static.rs | 2 +- src/test/run-fail/fail-non-utf8.rs | 2 +- src/test/run-fail/fail-task-name-none.rs | 2 +- src/test/run-fail/fail-task-name-owned.rs | 2 +- src/test/run-fail/fail-task-name-send-str.rs | 2 +- src/test/run-fail/fail-task-name-static.rs | 2 +- src/test/run-fail/glob-use-std.rs | 2 +- src/test/run-fail/issue-12920.rs | 2 +- src/test/run-fail/issue-2444.rs | 2 +- src/test/run-fail/main-fail.rs | 2 +- src/test/run-fail/match-bot-fail.rs | 2 +- src/test/run-fail/native-failure.rs | 2 +- src/test/run-fail/test-fail.rs | 2 +- src/test/run-fail/unique-fail.rs | 2 +- src/test/run-make/no-duplicate-libs/bar.rs | 2 +- src/test/run-make/no-duplicate-libs/foo.rs | 2 +- src/test/run-pass/smallest-hello-world.rs | 2 +- 40 files changed, 104 insertions(+), 60 deletions(-) diff --git a/src/doc/guide-unsafe.md b/src/doc/guide-unsafe.md index cade043a793..4d6dde7f57f 100644 --- a/src/doc/guide-unsafe.md +++ b/src/doc/guide-unsafe.md @@ -462,7 +462,7 @@ fn start(_argc: int, _argv: *const *const u8) -> int { // provided by libstd. #[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 {} } # // fn main() {} tricked you, rustdoc! ``` @@ -485,7 +485,7 @@ pub extern fn main(argc: int, argv: *const *const u8) -> int { #[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 {} } # // fn main() {} tricked you, rustdoc! ``` @@ -505,7 +505,7 @@ failure mechanisms of the compiler. This is often mapped to GCC's personality function (see the [libstd implementation](std/rt/unwind/index.html) for more information), but crates which do not trigger a panic can be assured -that this function is never called. The final function, `fail_fmt`, is +that this function is never called. The final function, `panic_fmt`, is also used by the failure mechanisms of the compiler. ## Using libcore @@ -565,8 +565,8 @@ pub extern fn dot_product(a: *const u32, a_len: u32, return ret; } -#[lang = "fail_fmt"] -extern fn fail_fmt(args: &core::fmt::Arguments, +#[lang = "panic_fmt"] +extern fn panic_fmt(args: &core::fmt::Arguments, file: &str, line: uint) -> ! { loop {} @@ -579,9 +579,9 @@ extern fn fail_fmt(args: &core::fmt::Arguments, ``` Note that there is one extra lang item here which differs from the examples -above, `fail_fmt`. This must be defined by consumers of libcore because the -core library declares failure, but it does not define it. The `fail_fmt` -lang item is this crate's definition of failure, and it must be guaranteed to +above, `panic_fmt`. This must be defined by consumers of libcore because the +core library declares panics, but it does not define it. The `panic_fmt` +lang item is this crate's definition of panic, and it must be guaranteed to never return. As can be seen in this example, the core library is intended to provide the @@ -686,7 +686,7 @@ fn main(argc: int, argv: *const *const u8) -> int { #[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 {} } ``` Note the use of `abort`: the `exchange_malloc` lang item is assumed to diff --git a/src/libcore/panicking.rs b/src/libcore/panicking.rs index cda21b6ecfa..62c9d907cb2 100644 --- a/src/libcore/panicking.rs +++ b/src/libcore/panicking.rs @@ -33,6 +33,49 @@ use fmt; use intrinsics; +// NOTE(stage0): remove after a snapshot +#[cfg(stage0)] +#[cold] #[inline(never)] // this is the slow path, always +#[lang="fail"] +pub fn panic(expr_file_line: &(&'static str, &'static str, uint)) -> ! { + let (expr, file, line) = *expr_file_line; + let ref file_line = (file, line); + format_args!(|args| -> () { + panic_fmt(args, file_line); + }, "{}", expr); + + unsafe { intrinsics::abort() } +} + +// NOTE(stage0): remove after a snapshot +#[cfg(stage0)] +#[cold] #[inline(never)] +#[lang="fail_bounds_check"] +fn panic_bounds_check(file_line: &(&'static str, uint), + index: uint, len: uint) -> ! { + format_args!(|args| -> () { + panic_fmt(args, file_line); + }, "index out of bounds: the len is {} but the index is {}", len, index); + unsafe { intrinsics::abort() } +} + +// NOTE(stage0): remove after a snapshot +#[cfg(stage0)] +#[cold] #[inline(never)] +pub fn panic_fmt(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! { + #[allow(ctypes)] + extern { + #[lang = "fail_fmt"] + fn panic_impl(fmt: &fmt::Arguments, file: &'static str, + line: uint) -> !; + + } + let (file, line) = *file_line; + unsafe { panic_impl(fmt, file, line) } +} + +// NOTE(stage0): remove cfg after a snapshot +#[cfg(not(stage0))] #[cold] #[inline(never)] // this is the slow path, always #[lang="panic"] pub fn panic(expr_file_line: &(&'static str, &'static str, uint)) -> ! { @@ -45,6 +88,8 @@ pub fn panic(expr_file_line: &(&'static str, &'static str, uint)) -> ! { unsafe { intrinsics::abort() } } +// NOTE(stage0): remove cfg after a snapshot +#[cfg(not(stage0))] #[cold] #[inline(never)] #[lang="panic_bounds_check"] fn panic_bounds_check(file_line: &(&'static str, uint), @@ -55,6 +100,8 @@ fn panic_bounds_check(file_line: &(&'static str, uint), unsafe { intrinsics::abort() } } +// NOTE(stage0): remove cfg after a snapshot +#[cfg(not(stage0))] #[cold] #[inline(never)] pub fn panic_fmt(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! { #[allow(ctypes)] diff --git a/src/librustc/middle/trans/controlflow.rs b/src/librustc/middle/trans/controlflow.rs index f7210bb4e08..911ae42e142 100644 --- a/src/librustc/middle/trans/controlflow.rs +++ b/src/librustc/middle/trans/controlflow.rs @@ -11,7 +11,7 @@ use llvm::*; use driver::config::FullDebugInfo; use middle::def; -use middle::lang_items::{FailFnLangItem, FailBoundsCheckFnLangItem}; +use middle::lang_items::{PanicFnLangItem, PanicBoundsCheckFnLangItem}; use middle::trans::_match; use middle::trans::adt; use middle::trans::base::*; @@ -498,7 +498,7 @@ pub fn trans_fail<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, let expr_file_line_const = C_struct(ccx, &[v_str, filename, line], false); let expr_file_line = consts::const_addr_of(ccx, expr_file_line_const, ast::MutImmutable); let args = vec!(expr_file_line); - let did = langcall(bcx, Some(sp), "", FailFnLangItem); + let did = langcall(bcx, Some(sp), "", PanicFnLangItem); let bcx = callee::trans_lang_call(bcx, did, args.as_slice(), @@ -525,7 +525,7 @@ pub fn trans_fail_bounds_check<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, let file_line_const = C_struct(ccx, &[filename, line], false); let file_line = consts::const_addr_of(ccx, file_line_const, ast::MutImmutable); let args = vec!(file_line, index, len); - let did = langcall(bcx, Some(sp), "", FailBoundsCheckFnLangItem); + let did = langcall(bcx, Some(sp), "", PanicBoundsCheckFnLangItem); let bcx = callee::trans_lang_call(bcx, did, args.as_slice(), diff --git a/src/librustrt/unwind.rs b/src/librustrt/unwind.rs index 96a584492ae..8279b7d9654 100644 --- a/src/librustrt/unwind.rs +++ b/src/librustrt/unwind.rs @@ -497,6 +497,14 @@ pub extern fn rust_begin_unwind(msg: &fmt::Arguments, begin_unwind_fmt(msg, &(file, line)) } +// NOTE(stage0): remove after a snapshot +#[cfg(not(test))] +#[lang = "fail_fmt"] +pub extern fn rust_fail_begin_unwind(msg: &fmt::Arguments, + file: &'static str, line: uint) -> ! { + rust_begin_unwind(msg, file, line) +} + /// The entry point for unwinding with a formatted message. /// /// This is designed to reduce the amount of code required at the call 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/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/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 `&` (expected (), found &-ptr) } 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/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/by-value-self-objects-fail.rs b/src/test/run-fail/by-value-self-objects-fail.rs index 5747aa7a838..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); diff --git a/src/test/run-fail/expr-fn-fail.rs b/src/test/run-fail/expr-fn-fail.rs index 179d52bda03..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() -> ! { 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 ad2ff7a8c6b..987bee55c60 100644 --- a/src/test/run-fail/expr-if-fail-fn.rs +++ b/src/test/run-fail/expr-if-fail-fn.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() -> ! { 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 d2214f8c398..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 { 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 78f9ce8cc29..069c1d5ed35 100644 --- a/src/test/run-fail/expr-match-fail-fn.rs +++ b/src/test/run-fail/expr-match-fail-fn.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() -> ! { 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 0354717291d..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 => { panic!() } }; } diff --git a/src/test/run-fail/fail-macro-any-wrapped.rs b/src/test/run-fail/fail-macro-any-wrapped.rs index 432647e0e2b..e25390a7986 100644 --- a/src/test/run-fail/fail-macro-any-wrapped.rs +++ b/src/test/run-fail/fail-macro-any-wrapped.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:failed at 'Box' +// error-pattern:panicked at 'Box' fn main() { 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 54704c44c01..b73c66c4f21 100644 --- a/src/test/run-fail/fail-macro-any.rs +++ b/src/test/run-fail/fail-macro-any.rs @@ -8,8 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:failed at 'Box' - +// error-pattern:panicked at 'Box' fn main() { 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 bc240181e4c..a8565549a03 100644 --- a/src/test/run-fail/fail-macro-explicit.rs +++ b/src/test/run-fail/fail-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 'explicit failure' +// error-pattern:panicked at 'explicit panic' fn main() { panic!(); diff --git a/src/test/run-fail/fail-macro-fmt.rs b/src/test/run-fail/fail-macro-fmt.rs index 069ffc4434f..ac50f02cf33 100644 --- a/src/test/run-fail/fail-macro-fmt.rs +++ b/src/test/run-fail/fail-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-fail-fmt 42 rust' +// error-pattern:panicked at 'test-fail-fmt 42 rust' fn main() { 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 477f3442804..2f695c4e4b7 100644 --- a/src/test/run-fail/fail-macro-owned.rs +++ b/src/test/run-fail/fail-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-fail-owned' +// error-pattern:panicked at 'test-fail-owned' fn main() { 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 51b70110da2..c62162da09b 100644 --- a/src/test/run-fail/fail-macro-static.rs +++ b/src/test/run-fail/fail-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-fail-static' +// error-pattern:panicked at 'test-fail-static' fn main() { panic!("test-fail-static"); diff --git a/src/test/run-fail/fail-non-utf8.rs b/src/test/run-fail/fail-non-utf8.rs index ba4ff1da7e0..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 { diff --git a/src/test/run-fail/fail-task-name-none.rs b/src/test/run-fail/fail-task-name-none.rs index a32b64f9105..3f8abc41ff7 100644 --- a/src/test/run-fail/fail-task-name-none.rs +++ b/src/test/run-fail/fail-task-name-none.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:task '' failed at 'test' +// error-pattern:task '' panicked at 'test' use std::task; diff --git a/src/test/run-fail/fail-task-name-owned.rs b/src/test/run-fail/fail-task-name-owned.rs index 7553347e20b..0a303475a29 100644 --- a/src/test/run-fail/fail-task-name-owned.rs +++ b/src/test/run-fail/fail-task-name-owned.rs @@ -8,7 +8,7 @@ // 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; 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 2dcf947d0a9..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,7 +8,7 @@ // 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 = diff --git a/src/test/run-fail/fail-task-name-static.rs b/src/test/run-fail/fail-task-name-static.rs index d1861931e60..21c019e1a74 100644 --- a/src/test/run-fail/fail-task-name-static.rs +++ b/src/test/run-fail/fail-task-name-static.rs @@ -8,7 +8,7 @@ // 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 = diff --git a/src/test/run-fail/glob-use-std.rs b/src/test/run-fail/glob-use-std.rs index cb66f2602d4..939845a7b34 100644 --- a/src/test/run-fail/glob-use-std.rs +++ b/src/test/run-fail/glob-use-std.rs @@ -14,7 +14,7 @@ // // Expanded pretty printing causes resolve conflicts. -// error-pattern:fail works +// error-pattern:panic works #![feature(globs)] use std::*; diff --git a/src/test/run-fail/issue-12920.rs b/src/test/run-fail/issue-12920.rs index ade098d721e..8dbfc06152a 100644 --- a/src/test/run-fail/issue-12920.rs +++ b/src/test/run-fail/issue-12920.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 pub fn main() { panic!(); println!("{}", 1i); diff --git a/src/test/run-fail/issue-2444.rs b/src/test/run-fail/issue-2444.rs index 8aaf38e251a..2b20540501e 100644 --- a/src/test/run-fail/issue-2444.rs +++ b/src/test/run-fail/issue-2444.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 use std::sync::Arc; diff --git a/src/test/run-fail/main-fail.rs b/src/test/run-fail/main-fail.rs index 6b1818b4fa2..b750501c265 100644 --- a/src/test/run-fail/main-fail.rs +++ b/src/test/run-fail/main-fail.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:task '
' failed at +// error-pattern:task '
' panicked at fn main() { panic!() diff --git a/src/test/run-fail/match-bot-fail.rs b/src/test/run-fail/match-bot-fail.rs index 8763f958a83..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)] diff --git a/src/test/run-fail/native-failure.rs b/src/test/run-fail/native-failure.rs index 6b5e3bafe79..0b261676cb2 100644 --- a/src/test/run-fail/native-failure.rs +++ b/src/test/run-fail/native-failure.rs @@ -9,7 +9,7 @@ // except according to those terms. // ignore-android (FIXME #11419) -// error-pattern:explicit failure +// error-pattern:explicit panic extern crate native; diff --git a/src/test/run-fail/test-fail.rs b/src/test/run-fail/test-fail.rs index 0c1f9424ba0..cd2ec834d82 100644 --- a/src/test/run-fail/test-fail.rs +++ b/src/test/run-fail/test-fail.rs @@ -9,7 +9,7 @@ // 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` diff --git a/src/test/run-fail/unique-fail.rs b/src/test/run-fail/unique-fail.rs index 93196344244..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 +// error-pattern: panic fn main() { box panic!(); } 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-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: 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]