File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -756,7 +756,7 @@ macro_rules! unsuffixed_integers {
756756impl Literal {
757757 pub unsafe fn from_str_unchecked ( repr : & str ) -> Self {
758758 if inside_proc_macro ( ) {
759- Literal :: Compiler ( compiler_literal_from_str ( repr) . expect ( "invalid literal" ) )
759+ Literal :: Compiler ( proc_macro :: Literal :: from_str ( repr) . expect ( "invalid literal" ) )
760760 } else {
761761 Literal :: Fallback ( fallback:: Literal :: from_str_unchecked ( repr) )
762762 }
@@ -879,18 +879,15 @@ impl FromStr for Literal {
879879
880880 fn from_str ( repr : & str ) -> Result < Self , Self :: Err > {
881881 if inside_proc_macro ( ) {
882- compiler_literal_from_str ( repr) . map ( Literal :: Compiler )
882+ let literal = proc_macro:: Literal :: from_str ( repr) ?;
883+ Ok ( Literal :: Compiler ( literal) )
883884 } else {
884885 let literal = fallback:: Literal :: from_str ( repr) ?;
885886 Ok ( Literal :: Fallback ( literal) )
886887 }
887888 }
888889}
889890
890- fn compiler_literal_from_str ( repr : & str ) -> Result < proc_macro:: Literal , LexError > {
891- proc_macro:: Literal :: from_str ( repr) . map_err ( LexError :: Compiler )
892- }
893-
894891impl Display for Literal {
895892 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
896893 match self {
You can’t perform that action at this time.
0 commit comments