Skip to content

Commit 1ecc70d

Browse files
authored
Merge pull request #1114 from mattheww/2021-12_range_patterns
Say that `...` range patterns are rejected in the 2021 edition
2 parents 954f3d4 + b83fcc1 commit 1ecc70d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/patterns.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,6 @@ A half-open range pattern in the style `a..` cannot be used to match within the
443443
A pattern `a..=b` must always have a ≤ b. It is an error to have a range pattern
444444
`10..=0`, for example.
445445

446-
The `...` syntax is kept for backwards compatibility.
447-
448446
Range patterns only work on scalar types. The accepted types are:
449447

450448
* 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
535533
ranges containing all Unicode Scalar Values: `'\u{0000}'..='\u{D7FF}'` and
536534
`'\u{E000}'..='\u{10FFFF}'`.
537535

536+
> **Edition Differences**: Before the 2021 edition, closed range patterns may also be written using `...` as an alternative to `..=`, with the same meaning.
537+
538538
## Reference patterns
539539

540540
> **<sup>Syntax</sup>**\

0 commit comments

Comments
 (0)