diff --git a/build.rs b/build.rs index 73901c75..178c7575 100644 --- a/build.rs +++ b/build.rs @@ -88,6 +88,10 @@ fn main() { println!("cargo:rustc-cfg=no_literal_from_str"); } + if version.minor < 55 { + println!("cargo:rustc-cfg=no_group_open_close"); + } + if version.minor < 57 { println!("cargo:rustc-cfg=no_is_available"); } diff --git a/src/wrapper.rs b/src/wrapper.rs index 614d0126..8583ed91 100644 --- a/src/wrapper.rs +++ b/src/wrapper.rs @@ -620,9 +620,9 @@ impl Group { pub fn span_open(&self) -> Span { match self { - #[cfg(proc_macro_span)] + #[cfg(not(no_group_open_close))] Group::Compiler(g) => Span::Compiler(g.span_open()), - #[cfg(not(proc_macro_span))] + #[cfg(no_group_open_close)] Group::Compiler(g) => Span::Compiler(g.span()), Group::Fallback(g) => Span::Fallback(g.span_open()), } @@ -630,9 +630,9 @@ impl Group { pub fn span_close(&self) -> Span { match self { - #[cfg(proc_macro_span)] + #[cfg(not(no_group_open_close))] Group::Compiler(g) => Span::Compiler(g.span_close()), - #[cfg(not(proc_macro_span))] + #[cfg(no_group_open_close)] Group::Compiler(g) => Span::Compiler(g.span()), Group::Fallback(g) => Span::Fallback(g.span_close()), }