File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 5
5
6
6
use std:: cell:: Cell ;
7
7
use std:: panic:: { catch_unwind, AssertUnwindSafe } ;
8
+ use std:: process;
8
9
9
10
thread_local ! {
10
11
static MY_COUNTER : Cell <usize > = Cell :: new( 0 ) ;
@@ -62,26 +63,26 @@ fn main() {
62
63
// Built-in panics; also make sure the message is right.
63
64
test ( Some ( "index out of bounds: the len is 3 but the index is 4" ) , |_old_val| {
64
65
let _val = [ 0 , 1 , 2 ] [ 4 ] ;
65
- loop { }
66
+ process :: abort ( )
66
67
} ) ;
67
68
test ( Some ( "attempt to divide by zero" ) , |_old_val| {
68
69
let _val = 1 / 0 ;
69
- loop { }
70
+ process :: abort ( )
70
71
} ) ;
71
72
72
73
test ( Some ( "align_offset: align is not a power-of-two" ) , |_old_val| {
73
74
let _ = std:: ptr:: null :: < u8 > ( ) . align_offset ( 3 ) ;
74
- loop { }
75
+ process :: abort ( )
75
76
} ) ;
76
77
77
78
// Assertion and debug assertion
78
79
test ( None , |_old_val| {
79
80
assert ! ( false ) ;
80
- loop { }
81
+ process :: abort ( )
81
82
} ) ;
82
83
test ( None , |_old_val| {
83
84
debug_assert ! ( false ) ;
84
- loop { }
85
+ process :: abort ( )
85
86
} ) ;
86
87
87
88
eprintln ! ( "Success!" ) ; // Make sure we get this in stderr
You can’t perform that action at this time.
0 commit comments