Skip to content

Commit 400a9ba

Browse files
authored
Rollup merge of #72077 - GuillaumeGomez:cleanup-E0571, r=Dylan-DPC
Improve E0571 wording r? @Dylan-DPC
2 parents 6a8ac8b + 0aaff14 commit 400a9ba

File tree

1 file changed

+3
-3
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+3
-3
lines changed

src/librustc_error_codes/error_codes/E0571.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Example of erroneous code:
77
# fn satisfied(n: usize) -> bool { n % 23 == 0 }
88
let result = while true {
99
if satisfied(i) {
10-
break 2*i; // error: `break` with value from a `while` loop
10+
break 2 * i; // error: `break` with value from a `while` loop
1111
}
1212
i += 1;
1313
};
@@ -22,9 +22,9 @@ Make sure `break value;` statements only occur in `loop` loops:
2222
```
2323
# let mut i = 1;
2424
# fn satisfied(n: usize) -> bool { n % 23 == 0 }
25-
let result = loop { // ok!
25+
let result = loop { // This is now a "loop" loop.
2626
if satisfied(i) {
27-
break 2*i;
27+
break 2 * i; // ok!
2828
}
2929
i += 1;
3030
};

0 commit comments

Comments
 (0)