@@ -153,9 +153,6 @@ fn leveled_feature_err<'a, S: Into<MultiSpan>>(
153153
154154}
155155
156- const EXPLAIN_BOX_SYNTAX : & str =
157- "box expression syntax is experimental; you can call `Box::new` instead" ;
158-
159156pub const EXPLAIN_STMT_ATTR_SYNTAX : & str =
160157 "attributes on expressions are experimental" ;
161158
@@ -503,9 +500,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
503500
504501 fn visit_expr ( & mut self , e : & ' a ast:: Expr ) {
505502 match e. kind {
506- ast:: ExprKind :: Box ( _) => {
507- gate_feature_post ! ( & self , box_syntax, e. span, EXPLAIN_BOX_SYNTAX ) ;
508- }
509503 ast:: ExprKind :: Type ( ..) => {
510504 // To avoid noise about type ascription in common syntax errors, only emit if it
511505 // is the *only* error.
@@ -809,6 +803,7 @@ pub fn check_crate(krate: &ast::Crate,
809803 gate_all ! ( exclusive_range_pattern, "exclusive range pattern syntax is experimental" ) ;
810804 gate_all ! ( try_blocks, "`try` blocks are unstable" ) ;
811805 gate_all ! ( label_break_value, "labels on blocks are unstable" ) ;
806+ gate_all ! ( box_syntax, "box expression syntax is experimental; you can call `Box::new` instead" ) ;
812807
813808 visit:: walk_crate ( & mut visitor, krate) ;
814809}
0 commit comments