From e1fa7326a06b879f514e44b3130a915367a84d5a Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 11 Mar 2023 14:36:48 -0800 Subject: [PATCH] Account for proc_macro::Span layout change between 1.31 and 1.32 --- Cargo.toml | 1 + tests/test_size.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index d653e6f1..1fa5b97e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,6 +25,7 @@ unicode-ident = "1.0" [dev-dependencies] quote = { version = "1.0", default_features = false } +rustversion = "1" [features] proc-macro = [] diff --git a/tests/test_size.rs b/tests/test_size.rs index a9ed9e20..338a9dde 100644 --- a/tests/test_size.rs +++ b/tests/test_size.rs @@ -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::(), 4); @@ -22,6 +23,7 @@ fn test_proc_macro2_fallback_span_size_with_locations() { assert_eq!(mem::size_of::>(), 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() {