diff options
Diffstat (limited to 'compiler/rustc_ast_passes/src/feature_gate.rs')
| -rw-r--r-- | compiler/rustc_ast_passes/src/feature_gate.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 277e82b4e53..81065fa3dce 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -413,10 +413,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { } } PatKind::Box(..) => { - if !self.features.deref_patterns { - // Allow box patterns under `deref_patterns`. - gate!(&self, box_patterns, pattern.span, "box pattern syntax is experimental"); - } + gate!(&self, box_patterns, pattern.span, "box pattern syntax is experimental"); } PatKind::Range(_, Some(_), Spanned { node: RangeEnd::Excluded, .. }) => { gate!( @@ -610,10 +607,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) { }; } - if !visitor.features.deref_patterns { - // Allow box patterns under `deref_patterns`. - gate_all_legacy_dont_use!(box_patterns, "box pattern syntax is experimental"); - } + gate_all_legacy_dont_use!(box_patterns, "box pattern syntax is experimental"); gate_all_legacy_dont_use!(trait_alias, "trait aliases are experimental"); // Despite being a new feature, `where T: Trait<Assoc(): Sized>`, which is RTN syntax now, // used to be gated under associated_type_bounds, which are right above, so RTN needs to |
