diff --git a/build.rs b/build.rs index 738031d..ebf41ea 100644 --- a/build.rs +++ b/build.rs @@ -58,10 +58,6 @@ fn main() { println!("cargo:rustc-cfg=span_locations"); } - if version.minor < 54 { - println!("cargo:rustc-cfg=no_literal_from_str"); - } - if version.minor < 55 { println!("cargo:rustc-cfg=no_group_open_close"); } diff --git a/src/wrapper.rs b/src/wrapper.rs index 1cf99fc..df97670 100644 --- a/src/wrapper.rs +++ b/src/wrapper.rs @@ -888,21 +888,7 @@ impl FromStr for Literal { } fn compiler_literal_from_str(repr: &str) -> Result { - #[cfg(not(no_literal_from_str))] - { - proc_macro::Literal::from_str(repr).map_err(LexError::Compiler) - } - #[cfg(no_literal_from_str)] - { - let tokens = proc_macro_parse(repr)?; - let mut iter = tokens.into_iter(); - if let (Some(proc_macro::TokenTree::Literal(literal)), None) = (iter.next(), iter.next()) { - if literal.to_string().len() == repr.len() { - return Ok(literal); - } - } - Err(LexError::call_site()) - } + proc_macro::Literal::from_str(repr).map_err(LexError::Compiler) } impl Display for Literal {