]> git.lizzy.rs Git - rust.git/commitdiff
Move `while let` behind `while_let` feature gate
authorJohn Gallagher <jgallagher@bignerdranch.com>
Fri, 3 Oct 2014 03:32:32 +0000 (23:32 -0400)
committerJohn Gallagher <jgallagher@bignerdranch.com>
Sat, 11 Oct 2014 00:30:32 +0000 (20:30 -0400)
src/doc/reference.md
src/libsyntax/feature_gate.rs

index c34a136a68e888e501d4f843743851c51ecb9d43..261e5edcf665ba00c85189f48a09e2abc14c1c3e 100644 (file)
@@ -2503,6 +2503,8 @@ The currently implemented features of the reference compiler are:
 
 * `if_let` - Allows use of the `if let` syntax.
 
+* `while_let` - Allows use of the `while let` syntax.
+
 * `intrinsics` - Allows use of the "rust-intrinsics" ABI. Compiler intrinsics
                  are inherently unstable and no promise about them is made.
 
index c3c36d044427220776f7d7f1f4524246b24359a1..28b20133a1f2b88e9e316f8ca8ace60664227af0 100644 (file)
@@ -73,6 +73,7 @@
     ("slicing_syntax", Active),
 
     ("if_let", Active),
+    ("while_let", Active),
 
     // if you change this list without updating src/doc/reference.md, cmr will be sad
 
@@ -356,6 +357,10 @@ fn visit_expr(&mut self, e: &ast::Expr) {
                                   e.span,
                                   "slicing syntax is experimental");
             }
+            ast::ExprWhileLet(..) => {
+                self.gate_feature("while_let", e.span,
+                                  "`while let` syntax is experimental");
+            }
             _ => {}
         }
         visit::walk_expr(self, e);