-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Open
Labels
A-grammarArea: The grammar of RustArea: The grammar of RustA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.F-exclusive_range_pattern`#![feature(exclusive_range_pattern)]``#![feature(exclusive_range_pattern)]`F-half_open_range_patterns`#![feature(half_open_range_patterns)]``#![feature(half_open_range_patterns)]`T-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.T-langRelevant to the language teamRelevant to the language team
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
A-grammarArea: The grammar of RustArea: The grammar of RustA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.F-exclusive_range_pattern`#![feature(exclusive_range_pattern)]``#![feature(exclusive_range_pattern)]`F-half_open_range_patterns`#![feature(half_open_range_patterns)]``#![feature(half_open_range_patterns)]`T-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.T-langRelevant to the language teamRelevant to the language team