File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
compiler/rustc_parse/src/parser Expand file tree Collapse file tree 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> {
345345 match self . parse_generics ( ) {
346346 Ok ( generic) => {
347347 if let TokenKind :: Ident ( symbol, _) = maybe_keyword. kind {
348- let ident_name = symbol. to_string ( ) ;
348+ let ident_name = symbol;
349349 // at this point, we've found something like
350350 // `fn <T>id`
351351 // and current token should be Ident with the item name (i.e. the function name)
@@ -355,9 +355,9 @@ impl<'a> Parser<'a> {
355355 let Ok ( snippet) = self . sess . source_map ( ) . span_to_snippet ( generic. span ) &&
356356 let Ok ( ident) = self . sess . source_map ( ) . span_to_snippet ( self . token . span ) {
357357 err. span_suggestion_verbose (
358- generic . span . to ( self . token . span ) ,
358+ self . token . span . shrink_to_hi ( ) ,
359359 format ! ( "place the generic parameter name after the {ident_name} name" ) ,
360- format ! ( " {ident}{ snippet}" ) ,
360+ snippet,
361361 Applicability :: MachineApplicable ,
362362 ) ;
363363 } else {
You can’t perform that action at this time.
0 commit comments