mirror of
https://gitee.com/openharmony/third_party_rust_proc-macro2
synced 2024-11-27 01:20:48 +00:00
Account for proc_macro::Span layout change between 1.31 and 1.32
This commit is contained in:
parent
6083bef110
commit
e1fa7326a0
@ -25,6 +25,7 @@ unicode-ident = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
quote = { version = "1.0", default_features = false }
|
||||
rustversion = "1"
|
||||
|
||||
[features]
|
||||
proc-macro = []
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user