1- #![ cfg( not( randomize_layout) ) ]
2-
31extern crate proc_macro;
42
53use std:: mem;
64
75#[ rustversion:: attr( before( 1.64 ) , ignore) ]
6+ #[ rustversion:: attr( since( 1.64 ) , cfg_attr( randomize_layout, ignore) ) ]
87#[ test]
98fn test_proc_macro_size ( ) {
109 assert_eq ! ( mem:: size_of:: <proc_macro:: Span >( ) , 4 ) ;
@@ -16,7 +15,7 @@ fn test_proc_macro_size() {
1615 assert_eq ! ( mem:: size_of:: <proc_macro:: TokenStream >( ) , 4 ) ;
1716}
1817
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) ]
2019#[ test]
2120fn test_proc_macro2_fallback_size_without_locations ( ) {
2221 assert_eq ! ( mem:: size_of:: <proc_macro2:: Span >( ) , 0 ) ;
@@ -28,7 +27,7 @@ fn test_proc_macro2_fallback_size_without_locations() {
2827 assert_eq ! ( mem:: size_of:: <proc_macro2:: TokenStream >( ) , 8 ) ;
2928}
3029
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) ]
3231#[ test]
3332fn test_proc_macro2_fallback_size_with_locations ( ) {
3433 assert_eq ! ( mem:: size_of:: <proc_macro2:: Span >( ) , 8 ) ;
@@ -43,7 +42,7 @@ fn test_proc_macro2_fallback_size_with_locations() {
4342#[ rustversion:: attr( before( 1.71 ) , ignore) ]
4443#[ rustversion:: attr(
4544 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)
4746) ]
4847#[ test]
4948fn test_proc_macro2_wrapper_size_without_locations ( ) {
@@ -59,7 +58,10 @@ fn test_proc_macro2_wrapper_size_without_locations() {
5958#[ rustversion:: attr( before( 1.65 ) , ignore) ]
6059#[ rustversion:: attr(
6160 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+ )
6365) ]
6466#[ test]
6567fn test_proc_macro2_wrapper_size_with_locations ( ) {
0 commit comments