Possible improvement in lack-of-semicolon error messages #36413
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Talking to some folks at RustConf recently a common point of confusion seemed to be "where are semicolons required?" The compiler seemingly has arcane restrictions at the beginning and this means that we can perhaps improve errors in this respect to help guide beginners!
For example, in this code:
it yields the error:
Perhaps we could detect that the other branch of the
if
has a semicolon, and as a result a semicolon here is probably also the fix?The text was updated successfully, but these errors were encountered: