Skip to content

Commit c41443a

Browse files
committed
stabilize slice_patterns
1 parent 35b5157 commit c41443a

File tree

3 files changed

+2
-24
lines changed

3 files changed

+2
-24
lines changed

src/librustc_ast_passes/feature_gate.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -470,29 +470,8 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
470470
visit::walk_expr(self, e)
471471
}
472472

473-
fn visit_arm(&mut self, arm: &'a ast::Arm) {
474-
visit::walk_arm(self, arm)
475-
}
476-
477473
fn visit_pat(&mut self, pattern: &'a ast::Pat) {
478474
match &pattern.kind {
479-
PatKind::Slice(pats) => {
480-
for pat in &*pats {
481-
let span = pat.span;
482-
let inner_pat = match &pat.kind {
483-
PatKind::Ident(.., Some(pat)) => pat,
484-
_ => pat,
485-
};
486-
if inner_pat.is_rest() {
487-
gate_feature_post!(
488-
&self,
489-
slice_patterns,
490-
span,
491-
"subslice patterns are unstable"
492-
);
493-
}
494-
}
495-
}
496475
PatKind::Box(..) => {
497476
gate_feature_post!(
498477
&self,

src/librustc_feature/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ declare_features! (
257257
/// Allows relaxing the coherence rules such that
258258
/// `impl<T> ForeignTrait<LocalType> for ForeignType<T>` is permitted.
259259
(accepted, re_rebalance_coherence, "1.41.0", Some(55437), None),
260+
/// Allows using subslice patterns, `[a, .., b]` and `[a, xs @ .., b]`.
261+
(accepted, slice_patterns, "1.42.0", Some(62254), None),
260262

261263
// -------------------------------------------------------------------------
262264
// feature-group-end: accepted features

src/librustc_feature/active.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,6 @@ declare_features! (
262262
/// Allows using non lexical lifetimes (RFC 2094).
263263
(active, nll, "1.0.0", Some(43234), None),
264264

265-
/// Allows using slice patterns.
266-
(active, slice_patterns, "1.0.0", Some(62254), None),
267-
268265
/// Allows the definition of `const` functions with some advanced features.
269266
(active, const_fn, "1.2.0", Some(57563), None),
270267

0 commit comments

Comments
 (0)