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 {
756
756
impl Literal {
757
757
pub unsafe fn from_str_unchecked ( repr : & str ) -> Self {
758
758
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" ) )
760
760
} else {
761
761
Literal :: Fallback ( fallback:: Literal :: from_str_unchecked ( repr) )
762
762
}
@@ -879,18 +879,15 @@ impl FromStr for Literal {
879
879
880
880
fn from_str ( repr : & str ) -> Result < Self , Self :: Err > {
881
881
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) )
883
884
} else {
884
885
let literal = fallback:: Literal :: from_str ( repr) ?;
885
886
Ok ( Literal :: Fallback ( literal) )
886
887
}
887
888
}
888
889
}
889
890
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
-
894
891
impl Display for Literal {
895
892
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
896
893
match self {
You can’t perform that action at this time.
0 commit comments