File tree Expand file tree Collapse file tree 2 files changed +0
-24
lines changed Expand file tree Collapse file tree 2 files changed +0
-24
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,6 @@ fn main() {
5858 println ! ( "cargo:rustc-cfg=span_locations" ) ;
5959 }
6060
61- if version. minor < 47 {
62- println ! ( "cargo:rustc-cfg=no_ident_new_raw" ) ;
63- }
64-
6561 if version. minor < 54 {
6662 println ! ( "cargo:rustc-cfg=no_literal_from_str" ) ;
6763 }
Original file line number Diff line number Diff line change @@ -654,27 +654,7 @@ impl Ident {
654654
655655 pub fn new_raw ( string : & str , span : Span ) -> Self {
656656 match span {
657- #[ cfg( not( no_ident_new_raw) ) ]
658657 Span :: Compiler ( s) => Ident :: Compiler ( proc_macro:: Ident :: new_raw ( string, s) ) ,
659- #[ cfg( no_ident_new_raw) ]
660- Span :: Compiler ( s) => {
661- let _ = proc_macro:: Ident :: new ( string, s) ;
662- // At this point the un-r#-prefixed string is known to be a
663- // valid identifier. Try to produce a valid raw identifier by
664- // running the `TokenStream` parser, and unwrapping the first
665- // token as an `Ident`.
666- let raw_prefixed = format ! ( "r#{}" , string) ;
667- if let Ok ( ts) = raw_prefixed. parse :: < proc_macro:: TokenStream > ( ) {
668- let mut iter = ts. into_iter ( ) ;
669- if let ( Some ( proc_macro:: TokenTree :: Ident ( mut id) ) , None ) =
670- ( iter. next ( ) , iter. next ( ) )
671- {
672- id. set_span ( s) ;
673- return Ident :: Compiler ( id) ;
674- }
675- }
676- panic ! ( "not allowed as a raw identifier: `{}`" , raw_prefixed)
677- }
678658 Span :: Fallback ( s) => Ident :: Fallback ( fallback:: Ident :: new_raw ( string, s) ) ,
679659 }
680660 }
You can’t perform that action at this time.
0 commit comments