about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorwhataloadofwhat <unusualmoniker@gmail.com>2017-02-10 17:55:00 +0000
committerwhataloadofwhat <unusualmoniker@gmail.com>2017-02-10 19:20:28 +0000
commitca92c516820e760173c40a9cbb42daef8111c93e (patch)
tree13238b866adec19d9f160027b9bcdc3945d65377 /src/test
parentf80514426aaf59967e08f32ec44c1876cdeffe9d (diff)
Change std::panicking::try::Data into a union
No longer potentially call `mem::uninitialized::<!>()`

Fixes #39432
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/catch-unwind-bang.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/run-pass/catch-unwind-bang.rs b/src/test/run-pass/catch-unwind-bang.rs
new file mode 100644
index 00000000000..df54ec90022
--- /dev/null
+++ b/src/test/run-pass/catch-unwind-bang.rs
@@ -0,0 +1,17 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn worker() -> ! {
+    panic!()
+}
+
+fn main() {
+    std::panic::catch_unwind(worker).unwrap_err();
+}