Skip to content

Say that ... range patterns are rejected in the 2021 edition #1114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 11, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.).
Expand Down Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify that before the 2021 edition ..= is also allowed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reworded in b83fcc1


## Reference patterns

> **<sup>Syntax</sup>**\
Expand Down