]> git.lizzy.rs Git - rust.git/commitdiff
Resolve merge conflict
authormatthewjasper <mjjasper1@gmail.com>
Sat, 22 Apr 2017 16:55:59 +0000 (17:55 +0100)
committermatthewjasper <mjjasper1@gmail.com>
Sat, 22 Apr 2017 16:55:59 +0000 (17:55 +0100)
1  2 
src/doc/unstable-book/src/SUMMARY.md
src/libsyntax/feature_gate.rs

index fa8be7bb23fb95b49d198bcc7b9278d6c01f47c4,ee4e568a5ca9af263cd3fc50537d3cd18b652a1b..1cfb46530237c1361a4893f832fd732d37b3c8d6
@@@ -71,6 -71,8 +71,7 @@@
      - [prelude_import](language-features/prelude-import.md)
      - [proc_macro](language-features/proc-macro.md)
      - [quote](language-features/quote.md)
 -    - [relaxed_adts](language-features/relaxed-adts.md)
+     - [repr_align](language-features/repr-align.md)
      - [repr_simd](language-features/repr-simd.md)
      - [rustc_attrs](language-features/rustc-attrs.md)
      - [rustc_diagnostic_macros](language-features/rustc-diagnostic-macros.md)
      - [windows_net](library-features/windows-net.md)
      - [windows_stdio](library-features/windows-stdio.md)
      - [zero_one](library-features/zero-one.md)
-->>>>>> Add top level sections to the Unstable Book.
index 81ab1a348d6cb0324243756967bd9479e16a6ca0,9b55a860b3595a0e4edd1bfb5e837d22f71ee7fd..fa0e45194dcb4e93f33962a379fd5f70cc171abf
@@@ -269,6 -269,9 +269,6 @@@ declare_features! 
      // Allows `impl Trait` in function return types.
      (active, conservative_impl_trait, "1.12.0", Some(34511)),
  
 -    // Permits numeric fields in struct expressions and patterns.
 -    (active, relaxed_adts, "1.12.0", Some(35626)),
 -
      // The `!` type
      (active, never_type, "1.13.0", Some(35121)),
  
      // Allows the `catch {...}` expression
      (active, catch_expr, "1.17.0", Some(31436)),
  
+     // Allows `repr(align(u16))` struct attribute (RFC 1358)
+     (active, repr_align, "1.17.0", Some(33626)),
      // See rust-lang/rfcs#1414. Allows code like `let x: &'static u32 = &42` to work.
      (active, rvalue_static_promotion, "1.15.1", Some(38865)),
  
@@@ -417,10 -423,7 +420,10 @@@ declare_features! 
      (accepted, pub_restricted, "1.18.0", Some(32409)),
      // The #![windows_subsystem] attribute
      (accepted, windows_subsystem, "1.18.0", Some(37499)),
 +    // Permits numeric fields in struct expressions and patterns.
 +    (accepted, relaxed_adts, "1.18.0", Some(35626)),
  );
 +
  // If you change this, please modify src/doc/unstable-book as well. You must
  // move that documentation into the relevant place in the other docs, and
  // remove the chapter on the flag.
@@@ -1102,6 -1105,10 +1105,6 @@@ fn contains_novel_literal(item: &ast::M
      }
  }
  
 -fn starts_with_digit(s: &str) -> bool {
 -    s.as_bytes().first().cloned().map_or(false, |b| b >= b'0' && b <= b'9')
 -}
 -
  impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
      fn visit_attribute(&mut self, attr: &ast::Attribute) {
          if !attr.span.allows_unstable() {
                                                      and possibly buggy");
  
                              }
+                             if item.check_name("align") {
+                                 gate_feature_post!(&self, repr_align, i.span,
+                                                    "the struct `#[repr(align(u16))]` attribute \
+                                                     is experimental");
+                             }
                          }
                      }
                  }
              ast::ExprKind::InPlace(..) => {
                  gate_feature_post!(&self, placement_in_syntax, e.span, EXPLAIN_PLACEMENT_IN);
              }
 -            ast::ExprKind::Struct(_, ref fields, _) => {
 -                for field in fields {
 -                    if starts_with_digit(&field.ident.node.name.as_str()) {
 -                        gate_feature_post!(&self, relaxed_adts,
 -                                          field.span,
 -                                          "numeric fields in struct expressions are unstable");
 -                    }
 -                }
 -            }
              ast::ExprKind::Break(_, Some(_)) => {
                  gate_feature_post!(&self, loop_break_value, e.span,
                                     "`break` with a value is experimental");
                                    pattern.span,
                                    "box pattern syntax is experimental");
              }
 -            PatKind::Struct(_, ref fields, _) => {
 -                for field in fields {
 -                    if starts_with_digit(&field.node.ident.name.as_str()) {
 -                        gate_feature_post!(&self, relaxed_adts,
 -                                          field.span,
 -                                          "numeric fields in struct patterns are unstable");
 -                    }
 -                }
 -            }
              PatKind::Range(_, _, RangeEnd::Excluded) => {
                  gate_feature_post!(&self, exclusive_range_pattern, pattern.span,
                                     "exclusive range pattern syntax is experimental");