mozilla/rust — Issue #1701: RFC: Allow matching against n-ary variants with just the name
Author: marijnh
Created: 2012-01-29 19:36:49+00:00
State: open
Labels: rfc

There's lot of stuff like this in the current code:

```
alt expr.node {
expr_field(_, _) | expr_index(_, _) { ... }
}
```

Where we need to have the `(_, _, _)` in there even though we just want to match a variant, and don't care about the arguments. If I understand correctly, we're already disallowing shadowing such variants in patterns, so it is probably a good idea to also allow matching against them with just their name. I.e.

```
alt expr.node {
expr_field | expr_index { ... }
}
```