Skip to content

Commit 154cab0

Browse files
committed
stabilize slice_patterns
1 parent 88d1109 commit 154cab0

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
@@ -497,29 +497,8 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
497497
visit::walk_expr(self, e)
498498
}
499499

500-
fn visit_arm(&mut self, arm: &'a ast::Arm) {
501-
visit::walk_arm(self, arm)
502-
}
503-
504500
fn visit_pat(&mut self, pattern: &'a ast::Pat) {
505501
match &pattern.kind {
506-
PatKind::Slice(pats) => {
507-
for pat in &*pats {
508-
let span = pat.span;
509-
let inner_pat = match &pat.kind {
510-
PatKind::Ident(.., Some(pat)) => pat,
511-
_ => pat,
512-
};
513-
if inner_pat.is_rest() {
514-
gate_feature_post!(
515-
&self,
516-
slice_patterns,
517-
span,
518-
"subslice patterns are unstable"
519-
);
520-
}
521-
}
522-
}
523502
PatKind::Box(..) => {
524503
gate_feature_post!(
525504
&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)