diff --git a/build.rs b/build.rs index 249d133..1a06e45 100644 --- a/build.rs +++ b/build.rs @@ -5,15 +5,10 @@ use std::str; fn main() { println!("cargo:rerun-if-changed=build.rs"); - let version = match rustc_version() { + let _version = match rustc_version() { Some(version) => version, None => return, }; - - if version.minor < 53 { - // https://github.com/rust-lang/rust/issues/43081 - println!("cargo:rustc-cfg=needs_invalid_span_workaround"); - } } struct RustcVersion { diff --git a/src/spanned.rs b/src/spanned.rs index efc2e8b..6eba644 100644 --- a/src/spanned.rs +++ b/src/spanned.rs @@ -26,20 +26,8 @@ impl Spanned for T { } fn join_spans(tokens: TokenStream) -> Span { - #[cfg(not(needs_invalid_span_workaround))] let mut iter = tokens.into_iter().map(|tt| tt.span()); - #[cfg(needs_invalid_span_workaround)] - let mut iter = tokens.into_iter().filter_map(|tt| { - let span = tt.span(); - let debug = format!("{:?}", span); - if debug.ends_with("bytes(0..0)") { - None - } else { - Some(span) - } - }); - let first = match iter.next() { Some(span) => span, None => return Span::call_site(),