From 0aaff14ae38aa24729fe2fc056ce9fc79b5dda57 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 10 May 2020 12:40:11 +0200 Subject: Improve E0571 wording --- src/librustc_error_codes/error_codes/E0571.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/librustc_error_codes/error_codes') 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; }; -- cgit 1.4.1-3-g733a5 From 806f09cf21129ec92c975e99443850d376281e04 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 11 May 2020 13:22:56 +0200 Subject: Clean up E0579 explanation --- src/librustc_error_codes/error_codes/E0579.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/librustc_error_codes/error_codes') 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. -- cgit 1.4.1-3-g733a5