Open
Description
(Or at least unnatural priorities.)
Binary range operators have higher priority than unary operators like &
or box
.
#![feature(exclusive_range_pattern)]
fn main() {
// Interpreted as (&0) .. (10), ERROR mismatched types
let x = &0 .. 10;
match &0 {
&0 .. 10 => {} // OK?!
_ => {}
}
}
We can change the priorities for all the unstable kinds of ranges and come up with some deprecation story for stable BEGIN ... END
.
Metadata
Metadata
Assignees
Labels
Area: The grammar of RustArea: The parsing of Rust source code to an ASTRelating to patterns and pattern matchingCategory: An issue proposing an enhancement or a PR with one.`#![feature(exclusive_range_pattern)]``#![feature(half_open_range_patterns)]`Relevant to the compiler team, which will review and decide on the PR/issue.Relevant to the language team, which will review and decide on the PR/issue.
Activity