Skip to content

Commit

Permalink
Stabilize dotdoteq_in_patterns language feature.
Browse files Browse the repository at this point in the history
Stabilize `match 2 { 1..=3 => {} }`.
  • Loading branch information
kennytm committed Mar 15, 2018
1 parent 92d1f8d commit a4d8033
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 37 deletions.
11 changes: 3 additions & 8 deletions src/libsyntax/feature_gate.rs
Expand Up @@ -26,7 +26,7 @@ use self::AttributeType::*;
use self::AttributeGate::*;

use abi::Abi;
use ast::{self, NodeId, PatKind, RangeEnd, RangeSyntax};
use ast::{self, NodeId, PatKind, RangeEnd};
use attr;
use epoch::Epoch;
use codemap::Spanned;
Expand Down Expand Up @@ -399,9 +399,6 @@ declare_features! (
// allow `'_` placeholder lifetimes
(active, underscore_lifetimes, "1.22.0", Some(44524), None),

// allow `..=` in patterns (RFC 1192)
(active, dotdoteq_in_patterns, "1.22.0", Some(28237), None),

// Default match binding modes (RFC 2005)
(active, match_default_bindings, "1.22.0", Some(42640), None),

Expand Down Expand Up @@ -553,6 +550,8 @@ declare_features! (
(accepted, use_nested_groups, "1.25.0", Some(44494), None),
// a..=b and ..=b
(accepted, inclusive_range_syntax, "1.26.0", Some(28237), None),
// allow `..=` in patterns (RFC 1192)
(accepted, dotdoteq_in_patterns, "1.26.0", Some(28237), None),
);

// If you change this, please modify src/doc/unstable-book as well. You must
Expand Down Expand Up @@ -1652,10 +1651,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
gate_feature_post!(&self, exclusive_range_pattern, pattern.span,
"exclusive range pattern syntax is experimental");
}
PatKind::Range(_, _, RangeEnd::Included(RangeSyntax::DotDotEq)) => {
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");
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/inc-range-pat.rs
Expand Up @@ -9,8 +9,6 @@
// except according to those terms.

// Test old and new syntax for inclusive range patterns.
#![feature(dotdoteq_in_patterns)]


fn main() {
assert!(match 42 { 0 ... 100 => true, _ => false });
Expand Down
16 changes: 0 additions & 16 deletions src/test/ui/feature-gate-dotdoteq_in_patterns.rs

This file was deleted.

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

This file was deleted.

0 comments on commit a4d8033

Please sign in to comment.