Skip to content

Commit 639b56c

Browse files
committed
rewrite foreign-rust-exceptions to rmake
1 parent ac815a5 commit 639b56c

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ run-make/extern-multiple-copies2/Makefile
2222
run-make/fmt-write-bloat/Makefile
2323
run-make/foreign-double-unwind/Makefile
2424
run-make/foreign-exceptions/Makefile
25-
run-make/foreign-rust-exceptions/Makefile
2625
run-make/incr-add-rust-src-component/Makefile
2726
run-make/incr-foreign-head-span/Makefile
2827
run-make/interdependent-c-libraries/Makefile

tests/run-make/foreign-rust-exceptions/Makefile

-13
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Rust exceptions can be foreign (from C code, in this test) or local. Foreign
2+
// exceptions should not be caught, as that can cause undefined behaviour. Instead
3+
// of catching them, #102721 made it so that the binary panics in execution with a helpful message.
4+
// This test checks that the correct message appears and that execution fails when trying to catch
5+
// a foreign exception.
6+
// See https://github.com/rust-lang/rust/issues/102715
7+
8+
//@ ignore-cross-compile
9+
// Reason: the compiled binary is executed
10+
//@ needs-unwind
11+
// Reason: unwinding panics is exercised in this test
12+
13+
//FIXME(Oneirical): ignore-i686-pc-windows-gnu
14+
// This test doesn't work on 32-bit MinGW as cdylib has its own copy of unwinder
15+
// so cross-DLL unwinding does not work.
16+
17+
use run_make_support::{run_fail, rustc};
18+
19+
fn main() {
20+
rustc().input("bar.rs").crate_type("cdylib").run();
21+
rustc().input("foo.rs").run();
22+
run_fail("foo").assert_stderr_contains("Rust cannot catch foreign exceptions");
23+
}

0 commit comments

Comments
 (0)