Add hint to "use break
" when attempting to implicit-break a loop
#84114
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
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=stable&mode=debug&edition=2018&gist=6ad29d6923c9ffe687e2a08669a03101
The current output is:
Ideally the output should look like:
It may not be immediately clear to a user why implicit-return/break style works for
if
expressions, but not forloop
. Adding a hint to explicitly break withbreak value;
would be helpful.The text was updated successfully, but these errors were encountered: