Skip to content

Commit

Permalink
stabilize pattern_parentheses feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed Sep 23, 2018
1 parent de5f6ee commit a381868
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 38 deletions.
9 changes: 2 additions & 7 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,6 @@ declare_features! (
// Multiple patterns with `|` in `if let` and `while let`
(active, if_while_or_patterns, "1.26.0", Some(48215), None),

// Parentheses in patterns
(active, pattern_parentheses, "1.26.0", Some(51087), None),

// Allows `#[repr(packed)]` attribute on structs
(active, repr_packed, "1.26.0", Some(33158), None),

Expand Down Expand Up @@ -680,6 +677,8 @@ declare_features! (
(accepted, extern_absolute_paths, "1.30.0", Some(44660), None),
// Access to crate names passed via `--extern` through prelude
(accepted, extern_prelude, "1.30.0", Some(44660), None),
// Parentheses in patterns
(accepted, pattern_parentheses, "1.31.0", Some(51087), None),
);

// If you change this, please modify src/doc/unstable-book as well. You must
Expand Down Expand Up @@ -1773,10 +1772,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
gate_feature_post!(&self, exclusive_range_pattern, pattern.span,
"exclusive range pattern syntax is experimental");
}
PatKind::Paren(..) => {
gate_feature_post!(&self, pattern_parentheses, pattern.span,
"parentheses in patterns are unstable");
}
_ => {}
}
visit::walk_pat(self, pattern)
Expand Down
4 changes: 1 addition & 3 deletions src/test/run-pass-fulldeps/ast_stmt_expr_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,7 @@ fn run() {
reject_stmt_parse("#[attr] #![attr] foo!{}");

// FIXME: Allow attributes in pattern constexprs?
// would require parens in patterns to allow disambiguation...
// —which is now available under the `pattern_parentheses` feature gate
// (tracking issue #51087)
// note: requires parens in patterns to allow disambiguation

reject_expr_parse("match 0 {
0..=#[attr] 10 => ()
Expand Down
15 changes: 0 additions & 15 deletions src/test/ui/feature-gates/feature-gate-pattern_parentheses.rs

This file was deleted.

11 changes: 0 additions & 11 deletions src/test/ui/feature-gates/feature-gate-pattern_parentheses.stderr

This file was deleted.

1 change: 0 additions & 1 deletion src/test/ui/run-pass/binding/pat-tuple-7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// except according to those terms.

// run-pass
#![feature(pattern_parentheses)]

fn main() {
match 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

// run-pass
#![feature(box_patterns, pattern_parentheses)]
#![feature(box_patterns)]

const VALUE: usize = 21;

Expand Down

0 comments on commit a381868

Please sign in to comment.