@@ -36,7 +36,6 @@ fn test_non_overlapping(a: &(usize, usize), b: &(usize, usize)) {
36
36
assert ! ( ( a. 1 <= b. 0 ) || ( b. 1 <= a. 0 ) ) ;
37
37
}
38
38
39
- #[ cfg_attr( test, test) ]
40
39
fn test_fields_non_overlapping ( ) {
41
40
let fields = [
42
41
span_of ! ( ReprRustStruct , x) ,
@@ -62,31 +61,17 @@ fn test_fields_non_overlapping() {
62
61
test_non_overlapping ( & fields[ 3 ] , & fields[ 4 ] ) ;
63
62
}
64
63
65
- #[ cfg_attr( test, test) ]
66
64
fn test_fields_aligned ( ) {
67
- assert_eq ! (
68
- ( core:: mem:: offset_of!( ReprRustStruct , x) % ( core:: mem:: align_of:: <i32 >( ) ) ) ,
69
- 0
70
- ) ;
71
- assert_eq ! (
72
- ( core:: mem:: offset_of!( ReprRustStruct , y) % ( core:: mem:: align_of:: <[ u32 ; 4 ] >( ) ) ) ,
73
- 0
74
- ) ;
75
- assert_eq ! (
76
- ( core:: mem:: offset_of!( ReprRustStruct , z) % ( core:: mem:: align_of:: <f32 >( ) ) ) ,
77
- 0
78
- ) ;
79
- assert_eq ! (
80
- ( core:: mem:: offset_of!( ReprRustStruct , a) % ( core:: mem:: align_of:: <u128 >( ) ) ) ,
81
- 0
82
- ) ;
65
+ assert_eq ! ( ( core:: mem:: offset_of!( ReprRustStruct , x) % ( core:: mem:: align_of:: <i32 >( ) ) ) , 0 ) ;
66
+ assert_eq ! ( ( core:: mem:: offset_of!( ReprRustStruct , y) % ( core:: mem:: align_of:: <[ u32 ; 4 ] >( ) ) ) , 0 ) ;
67
+ assert_eq ! ( ( core:: mem:: offset_of!( ReprRustStruct , z) % ( core:: mem:: align_of:: <f32 >( ) ) ) , 0 ) ;
68
+ assert_eq ! ( ( core:: mem:: offset_of!( ReprRustStruct , a) % ( core:: mem:: align_of:: <u128 >( ) ) ) , 0 ) ;
83
69
assert_eq ! (
84
70
( core:: mem:: offset_of!( ReprRustStruct , b) % ( core:: mem:: align_of:: <Overaligned >( ) ) ) ,
85
71
0
86
72
) ;
87
73
}
88
74
89
- #[ cfg( not( test) ) ]
90
75
fn main ( ) {
91
76
test_fields_non_overlapping ( ) ;
92
77
test_fields_aligned ( ) ;
0 commit comments