From 56c04ea4a23673947191de8904bb4c391dd7b985 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 16 Jul 2023 11:40:26 -0700 Subject: [PATCH] Delete no_hygiene config for rustc older than 1.45 --- build.rs | 4 ---- src/fallback.rs | 1 - src/lib.rs | 3 --- src/wrapper.rs | 13 ------------- 4 files changed, 21 deletions(-) diff --git a/build.rs b/build.rs index edb351a..5c61765 100644 --- a/build.rs +++ b/build.rs @@ -58,10 +58,6 @@ fn main() { println!("cargo:rustc-cfg=span_locations"); } - if version.minor < 45 { - println!("cargo:rustc-cfg=no_hygiene"); - } - if version.minor < 47 { println!("cargo:rustc-cfg=no_ident_new_raw"); } diff --git a/src/fallback.rs b/src/fallback.rs index 7a065f2..daa1e17 100644 --- a/src/fallback.rs +++ b/src/fallback.rs @@ -463,7 +463,6 @@ impl Span { Span { lo: 0, hi: 0 } } - #[cfg(not(no_hygiene))] pub fn mixed_site() -> Self { Span::call_site() } diff --git a/src/lib.rs b/src/lib.rs index e4985be..f7d8610 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -400,9 +400,6 @@ impl Span { /// The span located at the invocation of the procedural macro, but with /// local variables, labels, and `$crate` resolved at the definition site /// of the macro. This is the same hygiene behavior as `macro_rules`. - /// - /// This function requires Rust 1.45 or later. - #[cfg(not(no_hygiene))] pub fn mixed_site() -> Self { Span::_new(imp::Span::mixed_site()) } diff --git a/src/wrapper.rs b/src/wrapper.rs index 52ba836..69376fc 100644 --- a/src/wrapper.rs +++ b/src/wrapper.rs @@ -397,7 +397,6 @@ impl Span { } } - #[cfg(not(no_hygiene))] pub fn mixed_site() -> Self { if inside_proc_macro() { Span::Compiler(proc_macro::Span::mixed_site()) @@ -417,13 +416,7 @@ impl Span { pub fn resolved_at(&self, other: Span) -> Span { match (self, other) { - #[cfg(not(no_hygiene))] (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.resolved_at(b)), - - // Name resolution affects semantics, but location is only cosmetic - #[cfg(no_hygiene)] - (Span::Compiler(_), Span::Compiler(_)) => other, - (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.resolved_at(b)), _ => mismatch(), } @@ -431,13 +424,7 @@ impl Span { pub fn located_at(&self, other: Span) -> Span { match (self, other) { - #[cfg(not(no_hygiene))] (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.located_at(b)), - - // Name resolution affects semantics, but location is only cosmetic - #[cfg(no_hygiene)] - (Span::Compiler(_), Span::Compiler(_)) => *self, - (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.located_at(b)), _ => mismatch(), }