1
Fork 0

Rollup merge of #127350 - veera-sivarajan:bugfix-126311, r=lcnr

Parser: Suggest Placing the Return Type After Function Parameters

Fixes #126311

This PR suggests placing the return type after the function parameters when it's misplaced after a `where` clause.

This also tangentially improves diagnostics for cases like [this](86d6f1312a/tests/ui/parser/issues/misplaced-return-type-without-where-issue-126311.rs (L1C1-L1C28)) and adds doc comments for `parser::AllowPlus`.
This commit is contained in:
Matthias Krüger 2024-07-19 10:48:03 +02:00 committed by GitHub
commit c86e13f330
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 215 additions and 39 deletions

View file

@ -524,6 +524,8 @@ parse_mismatched_closing_delimiter = mismatched closing delimiter: `{$delimiter}
.label_opening_candidate = closing delimiter possibly meant for this
.label_unclosed = unclosed delimiter
parse_misplaced_return_type = place the return type after the function parameters
parse_missing_comma_after_match_arm = expected `,` following `match` arm
.suggestion = missing a comma here to end this `match` arm