File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/tools/miri/tests/pass/panic Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 55
66use std:: cell:: Cell ;
77use std:: panic:: { catch_unwind, AssertUnwindSafe } ;
8+ use std:: process;
89
910thread_local ! {
1011 static MY_COUNTER : Cell <usize > = Cell :: new( 0 ) ;
@@ -62,26 +63,26 @@ fn main() {
6263 // Built-in panics; also make sure the message is right.
6364 test ( Some ( "index out of bounds: the len is 3 but the index is 4" ) , |_old_val| {
6465 let _val = [ 0 , 1 , 2 ] [ 4 ] ;
65- loop { }
66+ process :: abort ( )
6667 } ) ;
6768 test ( Some ( "attempt to divide by zero" ) , |_old_val| {
6869 let _val = 1 / 0 ;
69- loop { }
70+ process :: abort ( )
7071 } ) ;
7172
7273 test ( Some ( "align_offset: align is not a power-of-two" ) , |_old_val| {
7374 let _ = std:: ptr:: null :: < u8 > ( ) . align_offset ( 3 ) ;
74- loop { }
75+ process :: abort ( )
7576 } ) ;
7677
7778 // Assertion and debug assertion
7879 test ( None , |_old_val| {
7980 assert ! ( false ) ;
80- loop { }
81+ process :: abort ( )
8182 } ) ;
8283 test ( None , |_old_val| {
8384 debug_assert ! ( false ) ;
84- loop { }
85+ process :: abort ( )
8586 } ) ;
8687
8788 eprintln ! ( "Success!" ) ; // Make sure we get this in stderr
You can’t perform that action at this time.
0 commit comments