Skip to content

Commit e1fa732

Browse files
committed
Account for proc_macro::Span layout change between 1.31 and 1.32
1 parent 6083bef commit e1fa732

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ unicode-ident = "1.0"
2525

2626
[dev-dependencies]
2727
quote = { version = "1.0", default_features = false }
28+
rustversion = "1"
2829

2930
[features]
3031
proc-macro = []

tests/test_size.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ extern crate proc_macro;
22

33
use std::mem;
44

5+
#[rustversion::attr(before(1.32), ignore)]
56
#[test]
67
fn test_proc_macro_span_size() {
78
assert_eq!(mem::size_of::<proc_macro::Span>(), 4);
@@ -22,6 +23,7 @@ fn test_proc_macro2_fallback_span_size_with_locations() {
2223
assert_eq!(mem::size_of::<Option<proc_macro2::Span>>(), 12);
2324
}
2425

26+
#[rustversion::attr(before(1.32), ignore)]
2527
#[cfg_attr(not(all(wrap_proc_macro, not(span_locations))), ignore)]
2628
#[test]
2729
fn test_proc_macro2_wrapper_span_size_without_locations() {

0 commit comments

Comments
 (0)