1
- #![ cfg( not( randomize_layout) ) ]
2
-
3
1
extern crate proc_macro;
4
2
5
3
use std:: mem;
6
4
7
5
#[ rustversion:: attr( before( 1.64 ) , ignore) ]
6
+ #[ rustversion:: attr( since( 1.64 ) , cfg_attr( randomize_layout, ignore) ) ]
8
7
#[ test]
9
8
fn test_proc_macro_size ( ) {
10
9
assert_eq ! ( mem:: size_of:: <proc_macro:: Span >( ) , 4 ) ;
@@ -16,7 +15,7 @@ fn test_proc_macro_size() {
16
15
assert_eq ! ( mem:: size_of:: <proc_macro:: TokenStream >( ) , 4 ) ;
17
16
}
18
17
19
- #[ cfg_attr( not ( all ( not ( wrap_proc_macro) , not ( span_locations) ) ) , ignore) ]
18
+ #[ cfg_attr( any ( randomize_layout , wrap_proc_macro, span_locations) , ignore) ]
20
19
#[ test]
21
20
fn test_proc_macro2_fallback_size_without_locations ( ) {
22
21
assert_eq ! ( mem:: size_of:: <proc_macro2:: Span >( ) , 0 ) ;
@@ -28,7 +27,7 @@ fn test_proc_macro2_fallback_size_without_locations() {
28
27
assert_eq ! ( mem:: size_of:: <proc_macro2:: TokenStream >( ) , 8 ) ;
29
28
}
30
29
31
- #[ cfg_attr( not ( all ( not ( wrap_proc_macro) , span_locations) ) , ignore) ]
30
+ #[ cfg_attr( any ( randomize_layout , wrap_proc_macro, not ( span_locations) ) , ignore) ]
32
31
#[ test]
33
32
fn test_proc_macro2_fallback_size_with_locations ( ) {
34
33
assert_eq ! ( mem:: size_of:: <proc_macro2:: Span >( ) , 8 ) ;
@@ -43,7 +42,7 @@ fn test_proc_macro2_fallback_size_with_locations() {
43
42
#[ rustversion:: attr( before( 1.71 ) , ignore) ]
44
43
#[ rustversion:: attr(
45
44
since( 1.71 ) ,
46
- cfg_attr( not ( all ( wrap_proc_macro , not( span_locations ) ) ) , ignore)
45
+ cfg_attr( any ( randomize_layout , not( wrap_proc_macro ) , span_locations ) , ignore)
47
46
) ]
48
47
#[ test]
49
48
fn test_proc_macro2_wrapper_size_without_locations ( ) {
@@ -59,7 +58,10 @@ fn test_proc_macro2_wrapper_size_without_locations() {
59
58
#[ rustversion:: attr( before( 1.65 ) , ignore) ]
60
59
#[ rustversion:: attr(
61
60
since( 1.65 ) ,
62
- cfg_attr( not( all( wrap_proc_macro, span_locations) ) , ignore)
61
+ cfg_attr(
62
+ any( randomize_layout, not( wrap_proc_macro) , not( span_locations) ) ,
63
+ ignore
64
+ )
63
65
) ]
64
66
#[ test]
65
67
fn test_proc_macro2_wrapper_size_with_locations ( ) {
0 commit comments