We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6930869 commit eb4caf1Copy full SHA for eb4caf1
src/test/run-make-fulldeps/foreign-rust-exceptions/Makefile
@@ -0,0 +1,6 @@
1
+include ../tools.mk
2
+
3
+all:
4
+ $(RUSTC) bar.rs --crate-type=cdylib
5
+ $(RUSTC) foo.rs
6
+ $(call RUN,foo) 2>&1 | $(CGREP) "Rust cannot catch foreign exceptions"
src/test/run-make-fulldeps/foreign-rust-exceptions/bar.rs
@@ -0,0 +1,7 @@
+#![crate_type = "cdylib"]
+#![feature(c_unwind)]
+#[no_mangle]
+extern "C-unwind" fn panic() {
+ panic!();
7
+}
src/test/run-make-fulldeps/foreign-rust-exceptions/foo.rs
@@ -0,0 +1,12 @@
+#[link(name = "bar")]
+extern "C-unwind" {
+ fn panic();
8
+fn main() {
9
+ let _ = std::panic::catch_unwind(|| {
10
+ unsafe { panic() };
11
+ });
12
0 commit comments