@@ -269,9 +269,6 @@ declare_features! (
269269 // Allows `impl Trait` in function return types.
270270 ( active, conservative_impl_trait, "1.12.0" , Some ( 34511 ) ) ,
271271
272- // Permits numeric fields in struct expressions and patterns.
273- ( active, relaxed_adts, "1.12.0" , Some ( 35626 ) ) ,
274-
275272 // The `!` type
276273 ( active, never_type, "1.13.0" , Some ( 35121 ) ) ,
277274
@@ -420,7 +417,10 @@ declare_features! (
420417 ( accepted, pub_restricted, "1.18.0" , Some ( 32409 ) ) ,
421418 // The #![windows_subsystem] attribute
422419 ( accepted, windows_subsystem, "1.18.0" , Some ( 37499 ) ) ,
420+ // Permits numeric fields in struct expressions and patterns.
421+ ( accepted, relaxed_adts, "1.18.0" , Some ( 35626 ) ) ,
423422) ;
423+
424424// If you change this, please modify src/doc/unstable-book as well. You must
425425// move that documentation into the relevant place in the other docs, and
426426// remove the chapter on the flag.
@@ -1102,10 +1102,6 @@ fn contains_novel_literal(item: &ast::MetaItem) -> bool {
11021102 }
11031103}
11041104
1105- fn starts_with_digit ( s : & str ) -> bool {
1106- s. as_bytes ( ) . first ( ) . cloned ( ) . map_or ( false , |b| b >= b'0' && b <= b'9' )
1107- }
1108-
11091105impl < ' a > Visitor < ' a > for PostExpansionVisitor < ' a > {
11101106 fn visit_attribute ( & mut self , attr : & ast:: Attribute ) {
11111107 if !attr. span . allows_unstable ( ) {
@@ -1283,15 +1279,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
12831279 ast:: ExprKind :: InPlace ( ..) => {
12841280 gate_feature_post ! ( & self , placement_in_syntax, e. span, EXPLAIN_PLACEMENT_IN ) ;
12851281 }
1286- ast:: ExprKind :: Struct ( _, ref fields, _) => {
1287- for field in fields {
1288- if starts_with_digit ( & field. ident . node . name . as_str ( ) ) {
1289- gate_feature_post ! ( & self , relaxed_adts,
1290- field. span,
1291- "numeric fields in struct expressions are unstable" ) ;
1292- }
1293- }
1294- }
12951282 ast:: ExprKind :: Break ( _, Some ( _) ) => {
12961283 gate_feature_post ! ( & self , loop_break_value, e. span,
12971284 "`break` with a value is experimental" ) ;
@@ -1335,15 +1322,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
13351322 pattern. span,
13361323 "box pattern syntax is experimental" ) ;
13371324 }
1338- PatKind :: Struct ( _, ref fields, _) => {
1339- for field in fields {
1340- if starts_with_digit ( & field. node . ident . name . as_str ( ) ) {
1341- gate_feature_post ! ( & self , relaxed_adts,
1342- field. span,
1343- "numeric fields in struct patterns are unstable" ) ;
1344- }
1345- }
1346- }
13471325 PatKind :: Range ( _, _, RangeEnd :: Excluded ) => {
13481326 gate_feature_post ! ( & self , exclusive_range_pattern, pattern. span,
13491327 "exclusive range pattern syntax is experimental" ) ;
0 commit comments