From 47259589a25ba5fb4aa6b1250f3956cc5cd39ea2 Mon Sep 17 00:00:00 2001 From: Matthew Woodcraft Date: Fri, 3 Dec 2021 15:38:06 +0000 Subject: [PATCH 1/2] Say that `...` range patterns are rejected in the 2021 edition --- src/patterns.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/patterns.md b/src/patterns.md index 8cd8af042..365ca529a 100644 --- a/src/patterns.md +++ b/src/patterns.md @@ -443,8 +443,6 @@ A half-open range pattern in the style `a..` cannot be used to match within the A pattern `a..=b` must always have a ≤ b. It is an error to have a range pattern `10..=0`, for example. -The `...` syntax is kept for backwards compatibility. - Range patterns only work on scalar types. The accepted types are: * Integer types (u8, i8, u16, i16, usize, isize, etc.). @@ -535,6 +533,8 @@ minimum to maximum value. The range of values for a `char` type are precisely th ranges containing all Unicode Scalar Values: `'\u{0000}'..='\u{D7FF}'` and `'\u{E000}'..='\u{10FFFF}'`. +> **Edition Differences**: Before the 2021 edition, closed range patterns may be written using `...` in place of `..=`, with the same meaning. + ## Reference patterns > **Syntax**\ From b83fcc16b1e1dba152277637991c863d5dc84a25 Mon Sep 17 00:00:00 2001 From: Matthew Woodcraft Date: Fri, 3 Dec 2021 15:58:39 +0000 Subject: [PATCH 2/2] Make it clearer that `..=` range patterns work in all editions --- src/patterns.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/patterns.md b/src/patterns.md index 365ca529a..31ce30b80 100644 --- a/src/patterns.md +++ b/src/patterns.md @@ -533,7 +533,7 @@ minimum to maximum value. The range of values for a `char` type are precisely th ranges containing all Unicode Scalar Values: `'\u{0000}'..='\u{D7FF}'` and `'\u{E000}'..='\u{10FFFF}'`. -> **Edition Differences**: Before the 2021 edition, closed range patterns may be written using `...` in place of `..=`, with the same meaning. +> **Edition Differences**: Before the 2021 edition, closed range patterns may also be written using `...` as an alternative to `..=`, with the same meaning. ## Reference patterns