-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-edition-2021Area: The 2021 editionArea: The 2021 editionA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingC-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
If I compile this:
fn main() {
let _b = matches!(b'3', b'0' ..= b'9');
}
With:
rustc 1.53.0-nightly (b84932674 2021-04-21)
binary: rustc
commit-hash: b849326744a8eec939e592f0ab13bff85cc865d3
commit-date: 2021-04-21
host: x86_64-pc-windows-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0
If I use the command:
...>rustc --edition 2018 -Z unstable-options test.rs
The compilation seems OK. If I compile with:
...>rustc --edition 2021 -Z unstable-options test.rs
rustc gives an error without line numbers:
error: `$pattern:pat` may be followed by `|`, which is not allowed for `pat` fragments
|
= note: allowed there are: `=>`, `,`, `=`, `if` or `in`
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
A-edition-2021Area: The 2021 editionArea: The 2021 editionA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingC-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.