File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -40,14 +40,6 @@ pub(crate) struct LexError {
40
40
}
41
41
42
42
impl LexError {
43
- // Codepaths that will need a meaningful span attached as part of
44
- // https://github.com/alexcrichton/proc-macro2/issues/178
45
- pub ( crate ) fn todo ( ) -> Self {
46
- LexError {
47
- span : Span :: call_site ( ) ,
48
- }
49
- }
50
-
51
43
pub ( crate ) fn span ( & self ) -> Span {
52
44
self . span
53
45
}
Original file line number Diff line number Diff line change @@ -108,7 +108,11 @@ impl FromStr for TokenStream {
108
108
// Work around https://github.com/rust-lang/rust/issues/58736.
109
109
fn proc_macro_parse ( src : & str ) -> Result < proc_macro:: TokenStream , LexError > {
110
110
let result = panic:: catch_unwind ( || src. parse ( ) . map_err ( LexError :: Compiler ) ) ;
111
- result. unwrap_or_else ( |_| Err ( LexError :: Fallback ( fallback:: LexError :: todo ( ) ) ) )
111
+ result. unwrap_or_else ( |_| {
112
+ Err ( LexError :: Fallback ( fallback:: LexError {
113
+ span : fallback:: Span :: call_site ( ) ,
114
+ } ) )
115
+ } )
112
116
}
113
117
114
118
impl Display for TokenStream {
@@ -279,7 +283,12 @@ impl Display for LexError {
279
283
#[ cfg( lexerror_display) ]
280
284
LexError :: Compiler ( e) => Display :: fmt ( e, f) ,
281
285
#[ cfg( not( lexerror_display) ) ]
282
- LexError :: Compiler ( _e) => Display :: fmt ( & fallback:: LexError :: todo ( ) , f) ,
286
+ LexError :: Compiler ( _e) => Display :: fmt (
287
+ & fallback:: LexError {
288
+ span : fallback:: Span :: call_site ( ) ,
289
+ } ,
290
+ f,
291
+ ) ,
283
292
LexError :: Fallback ( e) => Display :: fmt ( e, f) ,
284
293
}
285
294
}
You can’t perform that action at this time.
0 commit comments