2022-02-21 17:37:52 -06:00
|
|
|
// test for #87707
|
|
|
|
// edition:2018
|
|
|
|
// run-fail
|
2022-03-06 20:38:42 -06:00
|
|
|
// exec-env:RUST_BACKTRACE=0
|
2022-02-21 17:37:52 -06:00
|
|
|
// check-run-results
|
2022-09-20 19:54:23 -05:00
|
|
|
// needs-unwind uses catch_unwind
|
2022-02-21 17:37:52 -06:00
|
|
|
|
|
|
|
use std::sync::Once;
|
|
|
|
use std::panic;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let o = Once::new();
|
|
|
|
let _ = panic::catch_unwind(|| {
|
|
|
|
o.call_once(|| panic!("Here Once instance is poisoned."));
|
|
|
|
});
|
|
|
|
o.call_once(|| {});
|
|
|
|
}
|