File tree Expand file tree Collapse file tree 3 files changed +23
-14
lines changed 
tests/run-make/foreign-rust-exceptions Expand file tree Collapse file tree 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
1414run-make/fmt-write-bloat/Makefile
1515run-make/foreign-double-unwind/Makefile
1616run-make/foreign-exceptions/Makefile
17- run-make/foreign-rust-exceptions/Makefile
1817run-make/incr-add-rust-src-component/Makefile
1918run-make/issue-35164/Makefile
2019run-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