Account for proc_macro::Span layout change between 1.31 and 1.32

This commit is contained in:
David Tolnay 2023-03-11 14:36:48 -08:00
parent 6083bef110
commit e1fa7326a0
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,7 @@ unicode-ident = "1.0"
[dev-dependencies]
quote = { version = "1.0", default_features = false }
rustversion = "1"
[features]
proc-macro = []

View File

@ -2,6 +2,7 @@ extern crate proc_macro;
use std::mem;
#[rustversion::attr(before(1.32), ignore)]
#[test]
fn test_proc_macro_span_size() {
assert_eq!(mem::size_of::<proc_macro::Span>(), 4);
@ -22,6 +23,7 @@ fn test_proc_macro2_fallback_span_size_with_locations() {
assert_eq!(mem::size_of::<Option<proc_macro2::Span>>(), 12);
}
#[rustversion::attr(before(1.32), ignore)]
#[cfg_attr(not(all(wrap_proc_macro, not(span_locations))), ignore)]
#[test]
fn test_proc_macro2_wrapper_span_size_without_locations() {