mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-18 18:04:13 +00:00
Rollup merge of #72077 - GuillaumeGomez:cleanup-E0571, r=Dylan-DPC
Improve E0571 wording r? @Dylan-DPC
This commit is contained in:
commit
400a9bae49
@ -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;
|
||||
};
|
||||
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user