diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2018-02-28 23:33:30 -0800 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2018-03-01 09:29:39 -0800 |
| commit | 38f4d557d0c227230a580b328ded5c06a4a20509 (patch) | |
| tree | d4683ad20f74dc1fea918beeea98ea4e51303f84 /src/libsyntax/feature_gate.rs | |
| parent | 39d5e1cba65be49248be82fcc3c965287a2a2cb1 (diff) | |
| parent | c9aff92e6dc3ea43228d3d4e24ee7f5485943569 (diff) | |
| download | rust-38f4d557d0c227230a580b328ded5c06a4a20509.tar.gz rust-38f4d557d0c227230a580b328ded5c06a4a20509.zip | |
Rollup merge of #48500 - petrochenkov:parpat, r=nikomatsakis
Support parentheses in patterns under feature gate This is a prerequisite for any other extensions to pattern syntax - `|` with multiple patterns, type ascription, `..PAT` in slice patterns. Closes https://github.com/rust-lang/rfcs/issues/554
Diffstat (limited to 'src/libsyntax/feature_gate.rs')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 6444c846a8b..70ea015de4e 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -449,6 +449,9 @@ declare_features! ( // Multiple patterns with `|` in `if let` and `while let` (active, if_while_or_patterns, "1.26.0", Some(48215)), + + // Parentheses in patterns + (active, pattern_parentheses, "1.26.0", None), ); declare_features! ( @@ -1663,6 +1666,10 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { gate_feature_post!(&self, dotdoteq_in_patterns, pattern.span, "`..=` syntax in patterns is experimental"); } + PatKind::Paren(..) => { + gate_feature_post!(&self, pattern_parentheses, pattern.span, + "parentheses in patterns are unstable"); + } _ => {} } visit::walk_pat(self, pattern) |
