Invalid syntax (missing comma) in non-exhaustive patterns error's suggestion involving macros #94866
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=b417dca9b7f8cab72fc583d6a97f97de
The current output is:
Rustc's suggested fix is:
which is not valid syntax:
The diagnostic appears to be getting misled by the fact that
m!()
expands to a braced block, which would not ordinarily require a trailing comma if written inline in the match arm. The diagnostic correctly suggests the comma if the macro expands to something different than a braced block.The text was updated successfully, but these errors were encountered: