stabilize slice_patterns
This commit is contained in:
parent
35b5157db5
commit
c41443a2b7
@ -470,29 +470,8 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
|
||||
visit::walk_expr(self, e)
|
||||
}
|
||||
|
||||
fn visit_arm(&mut self, arm: &'a ast::Arm) {
|
||||
visit::walk_arm(self, arm)
|
||||
}
|
||||
|
||||
fn visit_pat(&mut self, pattern: &'a ast::Pat) {
|
||||
match &pattern.kind {
|
||||
PatKind::Slice(pats) => {
|
||||
for pat in &*pats {
|
||||
let span = pat.span;
|
||||
let inner_pat = match &pat.kind {
|
||||
PatKind::Ident(.., Some(pat)) => pat,
|
||||
_ => pat,
|
||||
};
|
||||
if inner_pat.is_rest() {
|
||||
gate_feature_post!(
|
||||
&self,
|
||||
slice_patterns,
|
||||
span,
|
||||
"subslice patterns are unstable"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
PatKind::Box(..) => {
|
||||
gate_feature_post!(
|
||||
&self,
|
||||
|
@ -257,6 +257,8 @@ declare_features! (
|
||||
/// Allows relaxing the coherence rules such that
|
||||
/// `impl<T> ForeignTrait<LocalType> for ForeignType<T>` is permitted.
|
||||
(accepted, re_rebalance_coherence, "1.41.0", Some(55437), None),
|
||||
/// Allows using subslice patterns, `[a, .., b]` and `[a, xs @ .., b]`.
|
||||
(accepted, slice_patterns, "1.42.0", Some(62254), None),
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// feature-group-end: accepted features
|
||||
|
@ -262,9 +262,6 @@ declare_features! (
|
||||
/// Allows using non lexical lifetimes (RFC 2094).
|
||||
(active, nll, "1.0.0", Some(43234), None),
|
||||
|
||||
/// Allows using slice patterns.
|
||||
(active, slice_patterns, "1.0.0", Some(62254), None),
|
||||
|
||||
/// Allows the definition of `const` functions with some advanced features.
|
||||
(active, const_fn, "1.2.0", Some(57563), None),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user