File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1+ #[ cfg( wrap_proc_macro) ]
2+ use crate :: imp;
13#[ cfg( span_locations) ]
24use crate :: location:: LineColumn ;
35use crate :: parse:: { self , Cursor } ;
@@ -1221,8 +1223,8 @@ fn escape_utf8(string: &str, repr: &mut String) {
12211223#[ cfg( feature = "proc-macro" ) ]
12221224pub ( crate ) trait FromStr2 : FromStr < Err = proc_macro:: LexError > {
12231225 #[ cfg( wrap_proc_macro) ]
1224- fn from_str_checked ( src : & str ) -> Result < Self , Self :: Err > {
1225- Self :: from_str ( src)
1226+ fn from_str_checked ( src : & str ) -> Result < Self , imp :: LexError > {
1227+ Self :: from_str ( src) . map_err ( imp :: LexError :: Compiler )
12261228 }
12271229
12281230 fn from_str_unchecked ( src : & str ) -> Self {
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ impl TokenStream {
9191 // Catch panic to work around https://github.com/rust-lang/rust/issues/58736.
9292 match panic:: catch_unwind ( || proc_macro:: TokenStream :: from_str_checked ( src) ) {
9393 Ok ( Ok ( tokens) ) => Ok ( TokenStream :: Compiler ( DeferredTokenStream :: new ( tokens) ) ) ,
94- Ok ( Err ( lex) ) => Err ( LexError :: Compiler ( lex) ) ,
94+ Ok ( Err ( lex) ) => Err ( lex) ,
9595 Err ( _panic) => Err ( LexError :: CompilerPanic ) ,
9696 }
9797 } else {
You can’t perform that action at this time.
0 commit comments