Skip to content

Commit 2a3e4c5

Browse files
committedJul 26, 2024
rewrite foreign-rust-exceptions to rmake
1 parent e2dbba8 commit 2a3e4c5

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
@@ -14,7 +14,6 @@ run-make/extern-fn-reachable/Makefile
1414
run-make/fmt-write-bloat/Makefile
1515
run-make/foreign-double-unwind/Makefile
1616
run-make/foreign-exceptions/Makefile
17-
run-make/foreign-rust-exceptions/Makefile
1817
run-make/incr-add-rust-src-component/Makefile
1918
run-make/issue-35164/Makefile
2019
run-make/issue-36710/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)