Skip to content

Commit aa64c20

Browse files
authored
Merge pull request #464 from dtolnay/testsize
Ignore size tests on non-64bit target
2 parents 1160ec3 + bc9f4d9 commit aa64c20

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

tests/test_size.rs

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ extern crate proc_macro;
33
use std::mem;
44

55
#[rustversion::attr(before(1.64), ignore)]
6-
#[rustversion::attr(since(1.64), cfg_attr(randomize_layout, ignore))]
6+
#[rustversion::attr(
7+
since(1.64),
8+
cfg_attr(any(randomize_layout, not(target_pointer_width = "64")), ignore)
9+
)]
710
#[test]
811
fn test_proc_macro_size() {
912
assert_eq!(mem::size_of::<proc_macro::Span>(), 4);
@@ -15,7 +18,15 @@ fn test_proc_macro_size() {
1518
assert_eq!(mem::size_of::<proc_macro::TokenStream>(), 4);
1619
}
1720

18-
#[cfg_attr(any(randomize_layout, wrap_proc_macro, span_locations), ignore)]
21+
#[cfg_attr(
22+
any(
23+
randomize_layout,
24+
not(target_pointer_width = "64"),
25+
wrap_proc_macro,
26+
span_locations
27+
),
28+
ignore
29+
)]
1930
#[test]
2031
fn test_proc_macro2_fallback_size_without_locations() {
2132
assert_eq!(mem::size_of::<proc_macro2::Span>(), 0);
@@ -27,7 +38,15 @@ fn test_proc_macro2_fallback_size_without_locations() {
2738
assert_eq!(mem::size_of::<proc_macro2::TokenStream>(), 8);
2839
}
2940

30-
#[cfg_attr(any(randomize_layout, wrap_proc_macro, not(span_locations)), ignore)]
41+
#[cfg_attr(
42+
any(
43+
randomize_layout,
44+
not(target_pointer_width = "64"),
45+
wrap_proc_macro,
46+
not(span_locations)
47+
),
48+
ignore
49+
)]
3150
#[test]
3251
fn test_proc_macro2_fallback_size_with_locations() {
3352
assert_eq!(mem::size_of::<proc_macro2::Span>(), 8);
@@ -42,7 +61,15 @@ fn test_proc_macro2_fallback_size_with_locations() {
4261
#[rustversion::attr(before(1.71), ignore)]
4362
#[rustversion::attr(
4463
since(1.71),
45-
cfg_attr(any(randomize_layout, not(wrap_proc_macro), span_locations), ignore)
64+
cfg_attr(
65+
any(
66+
randomize_layout,
67+
not(target_pointer_width = "64"),
68+
not(wrap_proc_macro),
69+
span_locations
70+
),
71+
ignore
72+
)
4673
)]
4774
#[test]
4875
fn test_proc_macro2_wrapper_size_without_locations() {
@@ -59,7 +86,12 @@ fn test_proc_macro2_wrapper_size_without_locations() {
5986
#[rustversion::attr(
6087
since(1.65),
6188
cfg_attr(
62-
any(randomize_layout, not(wrap_proc_macro), not(span_locations)),
89+
any(
90+
randomize_layout,
91+
not(target_pointer_width = "64"),
92+
not(wrap_proc_macro),
93+
not(span_locations)
94+
),
6395
ignore
6496
)
6597
)]

0 commit comments

Comments
 (0)