File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -70,14 +70,16 @@ fn test_writer_hasher() {
7070 let ptr = 5_usize as * mut i32 ;
7171 assert_eq ! ( hash( & ptr) , 5 ) ;
7272
73+ if cfg ! ( miri) { // Miri cannot hash pointers
74+ return ;
75+ }
76+
7377 let cs: & mut [ u8 ] = & mut [ 1 , 2 , 3 ] ;
7478 let ptr = cs. as_ptr ( ) ;
7579 let slice_ptr = cs as * const [ u8 ] ;
76- #[ cfg( not( miri) ) ] // Miri cannot hash pointers
7780 assert_eq ! ( hash( & slice_ptr) , hash( & ptr) + cs. len( ) as u64 ) ;
7881
7982 let slice_ptr = cs as * mut [ u8 ] ;
80- #[ cfg( not( miri) ) ] // Miri cannot hash pointers
8183 assert_eq ! ( hash( & slice_ptr) , hash( & ptr) + cs. len( ) as u64 ) ;
8284}
8385
Original file line number Diff line number Diff line change @@ -31,7 +31,11 @@ fn ordinary() {
3131 test_literal ! ( 0.1 ) ;
3232 test_literal ! ( 12345. ) ;
3333 test_literal ! ( 0.9999999 ) ;
34- #[ cfg( not( miri) ) ] // Miri is too slow
34+
35+ if cfg ! ( miri) { // Miri is too slow
36+ return ;
37+ }
38+
3539 test_literal ! ( 2.2250738585072014e-308 ) ;
3640}
3741
@@ -77,9 +81,12 @@ fn infinity() {
7781fn zero ( ) {
7882 test_literal ! ( 0.0 ) ;
7983 test_literal ! ( 1e-325 ) ;
80- #[ cfg( not( miri) ) ] // Miri is too slow
84+
85+ if cfg ! ( miri) { // Miri is too slow
86+ return ;
87+ }
88+
8189 test_literal ! ( 1e-326 ) ;
82- #[ cfg( not( miri) ) ] // Miri is too slow
8390 test_literal ! ( 1e-500 ) ;
8491}
8592
You can’t perform that action at this time.
0 commit comments