File tree 1 file changed +3
-3
lines changed
compiler/rustc_parse/src/parser
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -345,7 +345,7 @@ impl<'a> Parser<'a> {
345
345
match self . parse_generics ( ) {
346
346
Ok ( generic) => {
347
347
if let TokenKind :: Ident ( symbol, _) = maybe_keyword. kind {
348
- let ident_name = symbol. to_string ( ) ;
348
+ let ident_name = symbol;
349
349
// at this point, we've found something like
350
350
// `fn <T>id`
351
351
// and current token should be Ident with the item name (i.e. the function name)
@@ -355,9 +355,9 @@ impl<'a> Parser<'a> {
355
355
let Ok ( snippet) = self . sess . source_map ( ) . span_to_snippet ( generic. span ) &&
356
356
let Ok ( ident) = self . sess . source_map ( ) . span_to_snippet ( self . token . span ) {
357
357
err. span_suggestion_verbose (
358
- generic . span . to ( self . token . span ) ,
358
+ self . token . span . shrink_to_hi ( ) ,
359
359
format ! ( "place the generic parameter name after the {ident_name} name" ) ,
360
- format ! ( " {ident}{ snippet}" ) ,
360
+ snippet,
361
361
Applicability :: MachineApplicable ,
362
362
) ;
363
363
} else {
You can’t perform that action at this time.
0 commit comments