File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,7 @@ pub enum ParseResult<T> {
271
271
Success ( T ) ,
272
272
/// Arm failed to match. If the second parameter is `token::Eof`, it indicates an unexpected
273
273
/// end of macro invocation. Otherwise, it indicates that no rules expected the given token.
274
- Failure ( syntax_pos:: Span , Token , String ) ,
274
+ Failure ( syntax_pos:: Span , Token , & ' static str ) ,
275
275
/// Fatal error (malformed macro?). Abort compilation.
276
276
Error ( syntax_pos:: Span , String ) ,
277
277
}
@@ -721,7 +721,7 @@ pub fn parse(
721
721
sess. source_map ( ) . next_point ( parser. span )
722
722
} ,
723
723
token:: Eof ,
724
- "missing tokens in macro arguments" . to_string ( ) ,
724
+ "missing tokens in macro arguments" ,
725
725
) ;
726
726
}
727
727
}
@@ -760,7 +760,7 @@ pub fn parse(
760
760
return Failure (
761
761
parser. span ,
762
762
parser. token ,
763
- "no rules expected this token in macro call" . to_string ( ) ,
763
+ "no rules expected this token in macro call" ,
764
764
) ;
765
765
}
766
766
// Dump all possible `next_items` into `cur_items` for the next iteration.
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ fn generic_extension<'cx>(cx: &'cx mut ExtCtxt,
202
202
let best_fail_msg = parse_failure_msg ( best_fail_tok. expect ( "ran no matchers" ) ) ;
203
203
let span = best_fail_spot. substitute_dummy ( sp) ;
204
204
let mut err = cx. struct_span_err ( span, & best_fail_msg) ;
205
- err. span_label ( span, best_fail_text. unwrap_or ( best_fail_msg) ) ;
205
+ err. span_label ( span, best_fail_text. unwrap_or ( & best_fail_msg) ) ;
206
206
if let Some ( sp) = def_span {
207
207
if cx. source_map ( ) . span_to_filename ( sp) . is_real ( ) && !sp. is_dummy ( ) {
208
208
err. span_label ( cx. source_map ( ) . def_span ( sp) , "when calling this macro" ) ;
You can’t perform that action at this time.
0 commit comments