Skip to content

Commit 1160ec3

Browse files
committed
Make size tests #[ignore] in cfg(randomize_layout)
1 parent 33c9578 commit 1160ec3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/test_size.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
#![cfg(not(randomize_layout))]
2-
31
extern crate proc_macro;
42

53
use std::mem;
64

75
#[rustversion::attr(before(1.64), ignore)]
6+
#[rustversion::attr(since(1.64), cfg_attr(randomize_layout, ignore))]
87
#[test]
98
fn 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]
2120
fn 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]
3332
fn 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]
4948
fn 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]
6567
fn test_proc_macro2_wrapper_size_with_locations() {

0 commit comments

Comments
 (0)