Skip to content

Commit a381868

Browse files
committed
stabilize pattern_parentheses feature
1 parent de5f6ee commit a381868

File tree

6 files changed

+4
-38
lines changed

6 files changed

+4
-38
lines changed

src/libsyntax/feature_gate.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,6 @@ declare_features! (
412412
// Multiple patterns with `|` in `if let` and `while let`
413413
(active, if_while_or_patterns, "1.26.0", Some(48215), None),
414414

415-
// Parentheses in patterns
416-
(active, pattern_parentheses, "1.26.0", Some(51087), None),
417-
418415
// Allows `#[repr(packed)]` attribute on structs
419416
(active, repr_packed, "1.26.0", Some(33158), None),
420417

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

685684
// If you change this, please modify src/doc/unstable-book as well. You must
@@ -1773,10 +1772,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
17731772
gate_feature_post!(&self, exclusive_range_pattern, pattern.span,
17741773
"exclusive range pattern syntax is experimental");
17751774
}
1776-
PatKind::Paren(..) => {
1777-
gate_feature_post!(&self, pattern_parentheses, pattern.span,
1778-
"parentheses in patterns are unstable");
1779-
}
17801775
_ => {}
17811776
}
17821777
visit::walk_pat(self, pattern)

src/test/run-pass-fulldeps/ast_stmt_expr_attr.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,7 @@ fn run() {
284284
reject_stmt_parse("#[attr] #![attr] foo!{}");
285285

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

291289
reject_expr_parse("match 0 {
292290
0..=#[attr] 10 => ()

src/test/ui/feature-gates/feature-gate-pattern_parentheses.rs

-15
This file was deleted.

src/test/ui/feature-gates/feature-gate-pattern_parentheses.stderr

-11
This file was deleted.

src/test/ui/run-pass/binding/pat-tuple-7.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

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

1413
fn main() {
1514
match 0 {

src/test/ui/run-pass/binding/range-inclusive-pattern-precedence.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// run-pass
12-
#![feature(box_patterns, pattern_parentheses)]
12+
#![feature(box_patterns)]
1313

1414
const VALUE: usize = 21;
1515

0 commit comments

Comments
 (0)