diff options
| author | Badel2 <2badel2@gmail.com> | 2017-09-21 12:14:14 +0200 |
|---|---|---|
| committer | Badel2 <2badel2@gmail.com> | 2017-09-22 22:05:46 +0200 |
| commit | 54c4a830843d8de97d1dd3f936f9e3415bc96ef9 (patch) | |
| tree | 6b00eca548df7533349a4ef6f2252594068bd84d /src/libsyntax | |
| parent | 7aabf572789dcae24cc8ce247f7d86bcc5d49a17 (diff) | |
| download | rust-54c4a830843d8de97d1dd3f936f9e3415bc96ef9.tar.gz rust-54c4a830843d8de97d1dd3f936f9e3415bc96ef9.zip | |
dotdoteq_in_patterns feature gate
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 2fc451d5d00..aa5a4143027 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -26,7 +26,7 @@ use self::AttributeType::*; use self::AttributeGate::*; use abi::Abi; -use ast::{self, NodeId, PatKind, RangeEnd}; +use ast::{self, NodeId, PatKind, RangeEnd, RangeSyntax}; use attr; use codemap::Spanned; use syntax_pos::Span; @@ -392,6 +392,9 @@ declare_features! ( // allow `'_` placeholder lifetimes (active, underscore_lifetimes, "1.22.0", Some(44524)), + + // allow `..=` in patterns (RFC 1192) + (active, dotdoteq_in_patterns, "1.22.0", Some(28237)), ); declare_features! ( @@ -1491,6 +1494,10 @@ 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"); + } _ => {} } visit::walk_pat(self, pattern) |
