diff options
| author | bors <bors@rust-lang.org> | 2020-05-11 23:14:06 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-05-11 23:14:06 +0000 |
| commit | 09c817eeb29e764cfc12d0a8d94841e3ffe34023 (patch) | |
| tree | f118ca7b1552fec31eb6a93009347897c3e0c18e /src/librustc_error_codes/error_codes | |
| parent | 99cb9ccb9ca2067ad6e60508e3d52da77396b2f1 (diff) | |
| parent | dfa3677bee58a39296daf85645eff7d51cbad8ae (diff) | |
| download | rust-09c817eeb29e764cfc12d0a8d94841e3ffe34023.tar.gz rust-09c817eeb29e764cfc12d0a8d94841e3ffe34023.zip | |
Auto merge of #72120 - Dylan-DPC:rollup-ca0tur2, r=Dylan-DPC
Rollup of 10 pull requests Successful merges: - #72014 (Deprecated emoji) - #72019 (Fix debug assertion in error code) - #72027 (Use CDN for ci-caches on download) - #72044 (use min_specialization for some rustc crates where it requires no changes) - #72052 (display `ConstKind::Param`) - #72067 (Emit a warning when optimization fuel runs out) - #72072 (doc: minus (U+2212) instead of dash (U+002D) for negative infinity) - #72077 (Improve E0571 wording) - #72107 (Clean up E0579 explanation) - #72109 (Fix clippy warnings) Failed merges: r? @ghost
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0571.md | 6 | ||||
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0579.md | 10 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/librustc_error_codes/error_codes/E0571.md b/src/librustc_error_codes/error_codes/E0571.md index c2a3a8d7588..eadae05aa30 100644 --- a/src/librustc_error_codes/error_codes/E0571.md +++ b/src/librustc_error_codes/error_codes/E0571.md @@ -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; }; diff --git a/src/librustc_error_codes/error_codes/E0579.md b/src/librustc_error_codes/error_codes/E0579.md index 225e27f0cab..f554242a3d4 100644 --- a/src/librustc_error_codes/error_codes/E0579.md +++ b/src/librustc_error_codes/error_codes/E0579.md @@ -1,7 +1,4 @@ -When matching against an exclusive range, the compiler verifies that the range -is non-empty. Exclusive range patterns include the start point but not the end -point, so this is equivalent to requiring the start of the range to be less -than the end of the range. +A lower range wasn't less than the upper range. Erroneous code example: @@ -17,3 +14,8 @@ fn main() { } } ``` + +When matching against an exclusive range, the compiler verifies that the range +is non-empty. Exclusive range patterns include the start point but not the end +point, so this is equivalent to requiring the start of the range to be less +than the end of the range. |
