diff options
Diffstat (limited to 'src/test/ui/panic-handler')
23 files changed, 0 insertions, 293 deletions
diff --git a/src/test/ui/panic-handler/auxiliary/some-panic-impl.rs b/src/test/ui/panic-handler/auxiliary/some-panic-impl.rs deleted file mode 100644 index 0348b3a2d..000000000 --- a/src/test/ui/panic-handler/auxiliary/some-panic-impl.rs +++ /dev/null @@ -1,11 +0,0 @@ -// no-prefer-dynamic - -#![crate_type = "rlib"] -#![no_std] - -use core::panic::PanicInfo; - -#[panic_handler] -fn panic(info: &PanicInfo) -> ! { - loop {} -} diff --git a/src/test/ui/panic-handler/auxiliary/weak-lang-items.rs b/src/test/ui/panic-handler/auxiliary/weak-lang-items.rs deleted file mode 100644 index 7a698cf76..000000000 --- a/src/test/ui/panic-handler/auxiliary/weak-lang-items.rs +++ /dev/null @@ -1,22 +0,0 @@ -// no-prefer-dynamic - -// This aux-file will require the eh_personality function to be codegen'd, but -// it hasn't been defined just yet. Make sure we don't explode. - -#![no_std] -#![crate_type = "rlib"] - -struct A; - -impl core::ops::Drop for A { - fn drop(&mut self) {} -} - -pub fn foo() { - let _a = A; - panic!("wut"); -} - -mod std { - pub use core::{option, fmt}; -} diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-1.rs b/src/test/ui/panic-handler/panic-handler-bad-signature-1.rs deleted file mode 100644 index 775961d3f..000000000 --- a/src/test/ui/panic-handler/panic-handler-bad-signature-1.rs +++ /dev/null @@ -1,13 +0,0 @@ -// compile-flags:-C panic=abort - -#![no_std] -#![no_main] - -use core::panic::PanicInfo; - -#[panic_handler] -fn panic( - info: PanicInfo, //~ ERROR argument should be `&PanicInfo` -) -> () //~ ERROR return type should be `!` -{ -} diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-1.stderr b/src/test/ui/panic-handler/panic-handler-bad-signature-1.stderr deleted file mode 100644 index 8b044f766..000000000 --- a/src/test/ui/panic-handler/panic-handler-bad-signature-1.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: return type should be `!` - --> $DIR/panic-handler-bad-signature-1.rs:11:6 - | -LL | ) -> () - | ^^ - -error: argument should be `&PanicInfo` - --> $DIR/panic-handler-bad-signature-1.rs:10:11 - | -LL | info: PanicInfo, - | ^^^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-2.rs b/src/test/ui/panic-handler/panic-handler-bad-signature-2.rs deleted file mode 100644 index 727934000..000000000 --- a/src/test/ui/panic-handler/panic-handler-bad-signature-2.rs +++ /dev/null @@ -1,14 +0,0 @@ -// compile-flags:-C panic=abort - -#![no_std] -#![no_main] - -use core::panic::PanicInfo; - -#[panic_handler] -fn panic( - info: &'static PanicInfo, //~ ERROR argument should be `&PanicInfo` -) -> ! -{ - loop {} -} diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-2.stderr b/src/test/ui/panic-handler/panic-handler-bad-signature-2.stderr deleted file mode 100644 index 5ab693420..000000000 --- a/src/test/ui/panic-handler/panic-handler-bad-signature-2.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: argument should be `&PanicInfo` - --> $DIR/panic-handler-bad-signature-2.rs:10:11 - | -LL | info: &'static PanicInfo, - | ^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-3.rs b/src/test/ui/panic-handler/panic-handler-bad-signature-3.rs deleted file mode 100644 index ab9c9d7f4..000000000 --- a/src/test/ui/panic-handler/panic-handler-bad-signature-3.rs +++ /dev/null @@ -1,11 +0,0 @@ -// compile-flags:-C panic=abort - -#![no_std] -#![no_main] - -use core::panic::PanicInfo; - -#[panic_handler] -fn panic() -> ! { //~ ERROR function should have one argument - loop {} -} diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-3.stderr b/src/test/ui/panic-handler/panic-handler-bad-signature-3.stderr deleted file mode 100644 index 0a70181fd..000000000 --- a/src/test/ui/panic-handler/panic-handler-bad-signature-3.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: function should have one argument - --> $DIR/panic-handler-bad-signature-3.rs:9:1 - | -LL | fn panic() -> ! { - | ^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-4.rs b/src/test/ui/panic-handler/panic-handler-bad-signature-4.rs deleted file mode 100644 index 8240ab083..000000000 --- a/src/test/ui/panic-handler/panic-handler-bad-signature-4.rs +++ /dev/null @@ -1,12 +0,0 @@ -// compile-flags:-C panic=abort - -#![no_std] -#![no_main] - -use core::panic::PanicInfo; - -#[panic_handler] -fn panic<T>(pi: &PanicInfo) -> ! { - //~^ ERROR should have no type parameters - loop {} -} diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-4.stderr b/src/test/ui/panic-handler/panic-handler-bad-signature-4.stderr deleted file mode 100644 index 5e46da121..000000000 --- a/src/test/ui/panic-handler/panic-handler-bad-signature-4.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: should have no type parameters - --> $DIR/panic-handler-bad-signature-4.rs:9:1 - | -LL | fn panic<T>(pi: &PanicInfo) -> ! { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/panic-handler/panic-handler-duplicate.rs b/src/test/ui/panic-handler/panic-handler-duplicate.rs deleted file mode 100644 index bd99af999..000000000 --- a/src/test/ui/panic-handler/panic-handler-duplicate.rs +++ /dev/null @@ -1,17 +0,0 @@ -// compile-flags:-C panic=abort - -#![feature(lang_items)] -#![no_std] -#![no_main] - -use core::panic::PanicInfo; - -#[panic_handler] -fn panic(info: &PanicInfo) -> ! { - loop {} -} - -#[lang = "panic_impl"] -fn panic2(info: &PanicInfo) -> ! { //~ ERROR found duplicate lang item `panic_impl` - loop {} -} diff --git a/src/test/ui/panic-handler/panic-handler-duplicate.stderr b/src/test/ui/panic-handler/panic-handler-duplicate.stderr deleted file mode 100644 index 8cdc4888d..000000000 --- a/src/test/ui/panic-handler/panic-handler-duplicate.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0152]: found duplicate lang item `panic_impl` - --> $DIR/panic-handler-duplicate.rs:15:1 - | -LL | fn panic2(info: &PanicInfo) -> ! { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: the lang item is first defined here - --> $DIR/panic-handler-duplicate.rs:10:1 - | -LL | fn panic(info: &PanicInfo) -> ! { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0152`. diff --git a/src/test/ui/panic-handler/panic-handler-missing.rs b/src/test/ui/panic-handler/panic-handler-missing.rs deleted file mode 100644 index 6bb062ba6..000000000 --- a/src/test/ui/panic-handler/panic-handler-missing.rs +++ /dev/null @@ -1,9 +0,0 @@ -// dont-check-compiler-stderr -// error-pattern: `#[panic_handler]` function required, but not found - -#![feature(lang_items)] -#![no_main] -#![no_std] - -#[lang = "eh_personality"] -fn eh() {} diff --git a/src/test/ui/panic-handler/panic-handler-requires-panic-info.rs b/src/test/ui/panic-handler/panic-handler-requires-panic-info.rs deleted file mode 100644 index f13c12fc5..000000000 --- a/src/test/ui/panic-handler/panic-handler-requires-panic-info.rs +++ /dev/null @@ -1,15 +0,0 @@ -// compile-flags:-C panic=abort -// error-pattern: language item required, but not found: `panic_info` - -#![feature(lang_items)] -#![feature(no_core)] -#![no_core] -#![no_main] - -#[panic_handler] -fn panic() -> ! { - loop {} -} - -#[lang = "sized"] -trait Sized {} diff --git a/src/test/ui/panic-handler/panic-handler-requires-panic-info.stderr b/src/test/ui/panic-handler/panic-handler-requires-panic-info.stderr deleted file mode 100644 index 2bae12efb..000000000 --- a/src/test/ui/panic-handler/panic-handler-requires-panic-info.stderr +++ /dev/null @@ -1,4 +0,0 @@ -error: language item required, but not found: `panic_info` - -error: aborting due to previous error - diff --git a/src/test/ui/panic-handler/panic-handler-std.rs b/src/test/ui/panic-handler/panic-handler-std.rs deleted file mode 100644 index 6183c886c..000000000 --- a/src/test/ui/panic-handler/panic-handler-std.rs +++ /dev/null @@ -1,12 +0,0 @@ -// normalize-stderr-test "loaded from .*libstd-.*.rlib" -> "loaded from SYSROOT/libstd-*.rlib" -// error-pattern: found duplicate lang item `panic_impl` - - -use std::panic::PanicInfo; - -#[panic_handler] -fn panic(info: PanicInfo) -> ! { - loop {} -} - -fn main() {} diff --git a/src/test/ui/panic-handler/panic-handler-std.stderr b/src/test/ui/panic-handler/panic-handler-std.stderr deleted file mode 100644 index 7c7feffe7..000000000 --- a/src/test/ui/panic-handler/panic-handler-std.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0152]: found duplicate lang item `panic_impl` - --> $DIR/panic-handler-std.rs:8:1 - | -LL | fn panic(info: PanicInfo) -> ! { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the lang item is first defined in crate `std` (which `panic_handler_std` depends on) - = note: first definition in `std` loaded from SYSROOT/libstd-*.rlib - = note: second definition in the local crate (`panic_handler_std`) - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0152`. diff --git a/src/test/ui/panic-handler/panic-handler-twice.rs b/src/test/ui/panic-handler/panic-handler-twice.rs deleted file mode 100644 index 05bef66d8..000000000 --- a/src/test/ui/panic-handler/panic-handler-twice.rs +++ /dev/null @@ -1,19 +0,0 @@ -// dont-check-compiler-stderr -// aux-build:some-panic-impl.rs - -#![feature(lang_items)] -#![no_std] -#![no_main] - -extern crate some_panic_impl; - -use core::panic::PanicInfo; - -#[panic_handler] -fn panic(info: &PanicInfo) -> ! { - //~^ ERROR found duplicate lang item `panic_impl` - loop {} -} - -#[lang = "eh_personality"] -fn eh() {} diff --git a/src/test/ui/panic-handler/panic-handler-wrong-location.rs b/src/test/ui/panic-handler/panic-handler-wrong-location.rs deleted file mode 100644 index dca591018..000000000 --- a/src/test/ui/panic-handler/panic-handler-wrong-location.rs +++ /dev/null @@ -1,8 +0,0 @@ -// compile-flags:-C panic=abort - -#![no_std] -#![no_main] - -#[panic_handler] //~ ERROR `panic_impl` language item must be applied to a function -#[no_mangle] -static X: u32 = 42; diff --git a/src/test/ui/panic-handler/panic-handler-wrong-location.stderr b/src/test/ui/panic-handler/panic-handler-wrong-location.stderr deleted file mode 100644 index ae3ed5ab1..000000000 --- a/src/test/ui/panic-handler/panic-handler-wrong-location.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0718]: `panic_impl` language item must be applied to a function - --> $DIR/panic-handler-wrong-location.rs:6:1 - | -LL | #[panic_handler] - | ^^^^^^^^^^^^^^^^ attribute should be applied to a function, not a static item - -error: `#[panic_handler]` function required, but not found - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0718`. diff --git a/src/test/ui/panic-handler/weak-lang-item-2.rs b/src/test/ui/panic-handler/weak-lang-item-2.rs deleted file mode 100644 index a429d8fab..000000000 --- a/src/test/ui/panic-handler/weak-lang-item-2.rs +++ /dev/null @@ -1,15 +0,0 @@ -// run-pass -// aux-build:weak-lang-items.rs - -// ignore-emscripten no threads support -// pretty-expanded FIXME #23616 - -extern crate weak_lang_items as other; - -use std::thread; - -fn main() { - let _ = thread::spawn(move|| { - other::foo() - }); -} diff --git a/src/test/ui/panic-handler/weak-lang-item.rs b/src/test/ui/panic-handler/weak-lang-item.rs deleted file mode 100644 index 14a07a9ef..000000000 --- a/src/test/ui/panic-handler/weak-lang-item.rs +++ /dev/null @@ -1,12 +0,0 @@ -// aux-build:weak-lang-items.rs -// error-pattern: `#[panic_handler]` function required, but not found -// error-pattern: language item required, but not found: `eh_personality` -// needs-unwind since it affects the error output -// ignore-emscripten missing eh_catch_typeinfo lang item - -#![no_std] - -extern crate core; -extern crate weak_lang_items; - -fn main() {} diff --git a/src/test/ui/panic-handler/weak-lang-item.stderr b/src/test/ui/panic-handler/weak-lang-item.stderr deleted file mode 100644 index 202f3309d..000000000 --- a/src/test/ui/panic-handler/weak-lang-item.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0259]: the name `core` is defined multiple times - --> $DIR/weak-lang-item.rs:9:1 - | -LL | extern crate core; - | ^^^^^^^^^^^^^^^^^^ `core` reimported here - | - = note: `core` must be defined only once in the type namespace of this module -help: you can use `as` to change the binding name of the import - | -LL | extern crate core as other_core; - | - -error: `#[panic_handler]` function required, but not found - -error: language item required, but not found: `eh_personality` - | - = note: this can occur when a binary crate with `#![no_std]` is compiled for a target where `eh_personality` is defined in the standard library - = help: you may be able to compile for a target that doesn't need `eh_personality`, specify a target with `--target` or in `.cargo/config` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0259`. |