This test case actually requires std::process.
//
// See issue #59123 for a full explanation.
-// ignore-emscripten (sizes don't match)
// needs-unwind Size of Futures change on panic=abort
// run-pass
// error-pattern: thread 'main' panicked at '`async fn` resumed after panicking'
// edition:2018
// ignore-wasm no panic or subprocess support
-// ignore-emscripten no panic or subprocess support
#![feature(generators, generator_trait)]
// Check that partially moved from function parameters are dropped after the
// named bindings that move from them.
-// ignore-wasm32-bare compiled with panic=abort by default
use std::{panic, cell::RefCell};
#![allow(unused_variables)]
#![allow(unused_imports)]
-// ignore-wasm32-bare compiled with panic=abort by default
// Test that builtin implementations of `Clone` cleanup everything
// in case of unwinding.
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
fn worker() -> ! {
panic!()
// build-pass
// compile-flags: -C panic=unwind
// needs-unwind
-// ignore-emscripten no panic_unwind implementation
-// ignore-wasm32 no panic_unwind implementation
-// ignore-wasm64 no panic_unwind implementation
#[cfg(panic = "abort")]
#![deny(rust_2021_incompatible_closure_captures)]
//~^ NOTE: the lint level is defined here
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(fn_traits)]
#![feature(never_type)]
// run-pass
// needs-unwind
// edition:2018
-// ignore-wasm32-bare compiled with panic=abort by default
#![allow(unused)]
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(generators, generator_trait)]
// run-pass
// needs-unwind
-// ignore-wasm32-bare no unwinding panic
-// ignore-avr no unwinding panic
-// ignore-nvptx64 no unwinding panic
static mut CHECK: usize = 0;
// compile-flags: --extern std=
// error-pattern: extern location for std does not exist
// needs-unwind since it affects the error output
-// ignore-emscripten compiled with panic=abort, personality not required
fn main() {}
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten no threads support
// rust-lang/rust#64655: with panic=unwind, a panic from a subroutine
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten no threads support
// rust-lang/rust#64655: with panic=unwind, a panic from a subroutine
// run-pass
// needs-unwind
-// ignore-wasm no unwind support
-// ignore-emscripten no unwind support
#![feature(generators, generator_trait)]
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(generators, generator_trait)]
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(generators, generator_trait)]
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(generators, generator_trait)]
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// revisions: mir thir strict
// [thir]compile-flags: -Zthir-unsafeck
// [strict]compile-flags: -Zstrict-init-checks
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// Check that values are not leaked when a dtor panics (#14875)
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
use std::panic;
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
use std::panic;
// compile-flags:--test -O
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#[test]
#[should_panic(expected = "creating inhabited type")]
// run-pass
// only-32bit too impatient for 2⁶⁴ items
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes -C opt-level=3
use std::panic;
// run-pass
// only-32bit too impatient for 2⁶⁴ items
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes -C opt-level=3
use std::panic;
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes
use std::panic;
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes
use std::panic;
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C overflow-checks
use std::panic;
// compile-flags: --test -C debug_assertions=yes
// revisions: std core
-// ignore-wasm32-bare compiled with panic=abort by default
#![cfg_attr(core, no_std)]
#[cfg(core)]
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(fn_traits)]
#![feature(never_type)]
// run-fail
// error-pattern:diverging_fn called
// error-pattern:0 dropped
-// ignore-emscripten no processes
// needs-unwind this test checks that a destructor is called after panicking
struct Droppable(u8);
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
use std::cell::RefCell;
use std::panic;
// needs-unwind
// error-pattern:panic 1
// error-pattern:drop 2
-// ignore-emscripten no processes
struct Droppable(u32);
impl Drop for Droppable {
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// See `mir_drop_order.rs` for more information
// run-pass
// compile-flags: -C debug_assertions=yes
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten dies with an LLVM error
use std::panic;
// 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 compiled with panic=abort, personality not required
#![no_std]
// needs-unwind
// error-pattern:is incompatible with this crate's strategy of `unwind`
// aux-build:needs-abort.rs
-// ignore-wasm32-bare compiled with panic=abort by default
extern crate needs_abort;
// aux-build:wants-panic-runtime-abort.rs
// aux-build:panic-runtime-lang-items.rs
// error-pattern: is not compiled with this crate's panic strategy `unwind`
-// ignore-wasm32-bare compiled with panic=abort by default
#![no_std]
#![no_main]
// error-pattern:is not compiled with this crate's panic strategy `unwind`
// aux-build:panic-runtime-abort.rs
// aux-build:panic-runtime-lang-items.rs
-// ignore-wasm32-bare compiled with panic=abort by default
#![no_std]
#![no_main]
// aux-build:panic-runtime-abort.rs
// aux-build:wants-panic-runtime-abort.rs
// aux-build:panic-runtime-lang-items.rs
-// ignore-wasm32-bare compiled with panic=abort by default
#![no_std]
#![no_main]
// run-pass
// needs-unwind
-// ignore-emscripten no subprocess support
#![feature(internal_output_capture)]
// run-pass
-// ignore-wasm32-bare compiled with panic=abort by default
// needs-unwind
// aux-build:reachable-unnameable-items.rs
// needs-unwind
// aux-build:expand-with-a-macro.rs
-// ignore-wasm32-bare compiled with panic=abort by default
#![deny(warnings)]
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(test)]
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// revisions: default mir-opt
//[mir-opt] compile-flags: -Zmir-opt-level=4
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![allow(dead_code, unreachable_code)]
// needs-unwind
// ignore-emscripten no processes
// ignore-sgx no processes
-// ignore-wasm32-bare no unwinding panic
-// ignore-avr no unwinding panic
-// ignore-nvptx64 no unwinding panic
use std::env;
use std::process::Command;
// compile-flags:--test
// run-pass
// needs-unwind
-// ignore-emscripten no subprocess support
use std::fmt;
use std::fmt::{Display, Formatter};
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: --test
#[test]
#[should_panic(expected = "foo")]
// build-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(c_unwind)]
#![warn(ffi_unwind_calls)]
// run-pass
// needs-unwind
// ignore-windows target requires uwtable
-// ignore-wasm32-bare no proper panic=unwind support
// compile-flags: -C panic=unwind -C force-unwind-tables=n
use std::panic::{self, AssertUnwindSafe};