Skip to content

fix: report expected type, found { in parser#21951

Merged
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
Amit5601:fix-parser-return-type
Apr 5, 2026
Merged

fix: report expected type, found { in parser#21951
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
Amit5601:fix-parser-return-type

Conversation

@Amit5601
Copy link
Copy Markdown
Contributor

@Amit5601 Amit5601 commented Apr 4, 2026

Fixes #19858.

Improves the parse error message when a developer forgets the -> before a function body block. Added a specific match arm for the { token in type_with_bounds_cond to report "expected type, found \{`"instead of the generic"expected type"` fallback.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 4, 2026
Copy link
Copy Markdown
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Apr 5, 2026
Merged via the queue into rust-lang:master with commit bc770a1 Apr 5, 2026
17 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not dealing with return type

3 participants