diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-43853.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-43853.rs b/src/test/ui/issues/issue-43853.rs new file mode 100644 index 000000000..3162c091c --- /dev/null +++ b/src/test/ui/issues/issue-43853.rs @@ -0,0 +1,18 @@ +// run-pass +// needs-unwind +// ignore-wasm32-bare compiled with panic=abort by default + +use std::panic; + +fn test() { + wait(|| panic!()); +} + +fn wait<T, F: FnOnce() -> T>(f: F) -> F::Output { + From::from(f()) +} + +fn main() { + let result = panic::catch_unwind(move || test()); + assert!(result.is_err()); +} |