-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.
Description
Issue by cmr
Friday Dec 05, 2014 at 23:28 GMT
For earlier discussion, see rust-lang/rust#19580
This issue was labelled with: A-grammar, B-clarifying, I-papercut in the Rust repository
The fact that
fn main() {
let x = &4i;
match x {
// wanted to type `e @ &1 ... &4`
e @ &1 ... 4 => println!("Got a small value: {}", e),
&val => println!("Got a value: {}", val),
}
}
works but
fn main() {
let x = &4i;
match x {
// wanted to type `e @ &1 ... &4`
e @ &(1 ... 4) => println!("Got a small value: {}", e),
&val => println!("Got a value: {}", val),
}
}
is quite surprising. Presumably the &(
is expecting a tuple pattern, should consider investigating and seeing if patterns can be parenthesized in general.
cc #11144
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.