@@ -12,8 +12,8 @@ use crate::errors::{
12
12
IncorrectAwait , IncorrectSemicolon , IncorrectUseOfAwait , ParenthesesInForHead ,
13
13
ParenthesesInForHeadSugg , PatternMethodParamWithoutBody , QuestionMarkInType ,
14
14
QuestionMarkInTypeSugg , SelfParamNotFirst , StructLiteralBodyWithoutPath ,
15
- StructLiteralBodyWithoutPathSugg , SuggEscapeToUseAsIdentifier ,
16
- SuggRemoveComma , UnexpectedConstInGenericParam , UnexpectedConstParamDeclaration ,
15
+ StructLiteralBodyWithoutPathSugg , SuggEscapeToUseAsIdentifier , SuggRemoveComma ,
16
+ UnexpectedConstInGenericParam , UnexpectedConstParamDeclaration ,
17
17
UnexpectedConstParamDeclarationSugg , UnmatchedAngleBrackets , UseEqInstead ,
18
18
} ;
19
19
@@ -328,7 +328,7 @@ impl<'a> Parser<'a> {
328
328
329
329
// FIXME: shreys write better rust
330
330
let err = ExpectedIdentifier {
331
- span : self . token . span ,
331
+ span : self . token . span ,
332
332
token : self . token . clone ( ) ,
333
333
suggest_raw,
334
334
suggest_remove_comma,
@@ -337,30 +337,28 @@ impl<'a> Parser<'a> {
337
337
338
338
if self . token == token:: Lt {
339
339
// HACK: shreys shut the compiler up about unused result
340
- let _ = self . parse_generics ( )
341
- . map ( |generic| {
342
- // at this point, token should be Ident with the fn name
340
+ let _ = self . parse_generics ( ) . map ( |generic| {
341
+ // at this point, token should be Ident with the fn name
343
342
344
- // FIXME: shreys the span should be the span of where the gneeric SHOULD go.
345
- // TODO: shreys what does this look like with invalid generic
346
- // TODO: shreys - what to do if no snippet? probably just HELP not suggestion
343
+ // FIXME: shreys the span should be the span of where the gneeric SHOULD go.
344
+ // TODO: shreys what does this look like with invalid generic
345
+ // TODO: shreys - what to do if no snippet? probably just HELP not suggestion
347
346
348
- let snippet = match self . sess . source_map ( ) . span_to_snippet ( generic. span ) {
349
- Ok ( snippet) => snippet,
350
- _ => "" . to_string ( )
351
- } ;
352
-
353
- err. span_suggestion (
354
- self . token . span . to ( generic. span . shrink_to_hi ( ) ) ,
355
- "help: place the generic parameter list after the function name:" ,
356
- snippet,
357
- Applicability :: MachineApplicable
358
- ) ;
359
- } ) ;
360
- }
347
+ let snippet = match self . sess . source_map ( ) . span_to_snippet ( generic. span ) {
348
+ Ok ( snippet) => snippet,
349
+ _ => "" . to_string ( ) ,
350
+ } ;
361
351
362
- err
352
+ err. span_suggestion (
353
+ self . token . span . to ( generic. span . shrink_to_hi ( ) ) ,
354
+ "help: place the generic parameter list after the function name:" ,
355
+ snippet,
356
+ Applicability :: MachineApplicable ,
357
+ ) ;
358
+ } ) ;
359
+ }
363
360
361
+ err
364
362
}
365
363
366
364
pub ( super ) fn expected_one_of_not_found (
0 commit comments