about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-02-10 23:41:38 -0500
committerGitHub <noreply@github.com>2017-02-10 23:41:38 -0500
commit6866df669ce01c8a46dde9e7f21cf7a32a1bfcb4 (patch)
treee7e48729e89a52f43d0bc321bebc990f49ac0b8c /src/test
parent0fd89adcaa54bac1314186de66890a74c8ffe179 (diff)
parentca92c516820e760173c40a9cbb42daef8111c93e (diff)
Rollup merge of #39721 - whataloadofwhat:catch-unwind-bang, r=alexcrichton
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();
+}