File tree 3 files changed +23
-14
lines changed
tests/run-make/foreign-rust-exceptions
3 files changed +23
-14
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ run-make/extern-fn-reachable/Makefile
14
14
run-make/fmt-write-bloat/Makefile
15
15
run-make/foreign-double-unwind/Makefile
16
16
run-make/foreign-exceptions/Makefile
17
- run-make/foreign-rust-exceptions/Makefile
18
17
run-make/incr-add-rust-src-component/Makefile
19
18
run-make/issue-35164/Makefile
20
19
run-make/issue-36710/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments