Skip to content

Commit

Permalink
Rollup merge of rust-lang#72077 - GuillaumeGomez:cleanup-E0571, r=Dyl…
Browse files Browse the repository at this point in the history
…an-DPC

Improve E0571 wording

r? @Dylan-DPC
  • Loading branch information
Dylan-DPC authored May 10, 2020
2 parents 7a1ea3e + 0aaff14 commit 41d1082
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustc_error_codes/error_codes/E0571.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Example of erroneous code:
# fn satisfied(n: usize) -> bool { n % 23 == 0 }
let result = while true {
if satisfied(i) {
break 2*i; // error: `break` with value from a `while` loop
break 2 * i; // error: `break` with value from a `while` loop
}
i += 1;
};
Expand All @@ -22,9 +22,9 @@ Make sure `break value;` statements only occur in `loop` loops:
```
# let mut i = 1;
# fn satisfied(n: usize) -> bool { n % 23 == 0 }
let result = loop { // ok!
let result = loop { // This is now a "loop" loop.
if satisfied(i) {
break 2*i;
break 2 * i; // ok!
}
i += 1;
};
Expand Down

0 comments on commit 41d1082

Please sign in to comment.