File tree 2 files changed +14
-5
lines changed
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() {
70
70
let ptr = 5_usize as * mut i32 ;
71
71
assert_eq ! ( hash( & ptr) , 5 ) ;
72
72
73
+ if cfg ! ( miri) { // Miri cannot hash pointers
74
+ return ;
75
+ }
76
+
73
77
let cs: & mut [ u8 ] = & mut [ 1 , 2 , 3 ] ;
74
78
let ptr = cs. as_ptr ( ) ;
75
79
let slice_ptr = cs as * const [ u8 ] ;
76
- #[ cfg( not( miri) ) ] // Miri cannot hash pointers
77
80
assert_eq ! ( hash( & slice_ptr) , hash( & ptr) + cs. len( ) as u64 ) ;
78
81
79
82
let slice_ptr = cs as * mut [ u8 ] ;
80
- #[ cfg( not( miri) ) ] // Miri cannot hash pointers
81
83
assert_eq ! ( hash( & slice_ptr) , hash( & ptr) + cs. len( ) as u64 ) ;
82
84
}
83
85
Original file line number Diff line number Diff line change @@ -31,7 +31,11 @@ fn ordinary() {
31
31
test_literal ! ( 0.1 ) ;
32
32
test_literal ! ( 12345. ) ;
33
33
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
+
35
39
test_literal ! ( 2.2250738585072014e-308 ) ;
36
40
}
37
41
@@ -77,9 +81,12 @@ fn infinity() {
77
81
fn zero ( ) {
78
82
test_literal ! ( 0.0 ) ;
79
83
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
+
81
89
test_literal ! ( 1e-326 ) ;
82
- #[ cfg( not( miri) ) ] // Miri is too slow
83
90
test_literal ! ( 1e-500 ) ;
84
91
}
85
92
You can’t perform that action at this time.
0 commit comments