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> {
271271 Success ( T ) ,
272272 /// Arm failed to match. If the second parameter is `token::Eof`, it indicates an unexpected
273273 /// 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 ) ,
275275 /// Fatal error (malformed macro?). Abort compilation.
276276 Error ( syntax_pos:: Span , String ) ,
277277}
@@ -721,7 +721,7 @@ pub fn parse(
721721 sess. source_map ( ) . next_point ( parser. span )
722722 } ,
723723 token:: Eof ,
724- "missing tokens in macro arguments" . to_string ( ) ,
724+ "missing tokens in macro arguments" ,
725725 ) ;
726726 }
727727 }
@@ -760,7 +760,7 @@ pub fn parse(
760760 return Failure (
761761 parser. span ,
762762 parser. token ,
763- "no rules expected this token in macro call" . to_string ( ) ,
763+ "no rules expected this token in macro call" ,
764764 ) ;
765765 }
766766 // 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,
202202 let best_fail_msg = parse_failure_msg ( best_fail_tok. expect ( "ran no matchers" ) ) ;
203203 let span = best_fail_spot. substitute_dummy ( sp) ;
204204 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) ) ;
206206 if let Some ( sp) = def_span {
207207 if cx. source_map ( ) . span_to_filename ( sp) . is_real ( ) && !sp. is_dummy ( ) {
208208 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