]> git.lizzy.rs Git - rust.git/commitdiff
Added feature gate for RFC 2008.
authorDavid Wood <david@davidtw.co>
Fri, 3 Nov 2017 19:14:39 +0000 (19:14 +0000)
committerDavid Wood <david@davidtw.co>
Fri, 3 Nov 2017 19:36:17 +0000 (19:36 +0000)
src/libsyntax/feature_gate.rs

index 30451ec757a9f5c0f17109795110e9fb50de53f4..3996bdb819db31ac9ab8e32edd00602dd9f2915c 100644 (file)
@@ -386,6 +386,9 @@ pub fn new() -> Features {
     // allow '|' at beginning of match arms (RFC 1925)
     (active, match_beginning_vert, "1.21.0", Some(44101)),
 
+    // Future-proofing enums/structs with #[non_exhaustive] attribute (RFC 2008)
+    (active, non_exhaustive, "1.22.0", Some(44109)),
+
     // Copy/Clone closures (RFC 2132)
     (active, clone_closures, "1.22.0", Some(44490)),
     (active, copy_closures, "1.22.0", Some(44490)),
@@ -614,6 +617,12 @@ pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
                                              not yet settled",
                                             cfg_fn!(structural_match))),
 
+    // RFC #2008
+    ("non_exhaustive", Whitelisted, Gated(Stability::Unstable,
+                                          "non_exhaustive",
+                                          "non exhaustive is an experimental feature",
+                                          cfg_fn!(non_exhaustive))),
+
     ("plugin", CrateLevel, Gated(Stability::Unstable,
                                  "plugin",
                                  "compiler plugins are experimental \