diff --git a/src/doc/reference.md b/src/doc/reference.md index c34a136a68e88..261e5edcf665b 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -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. diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index c3c36d0444272..28b20133a1f2b 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -73,6 +73,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[ ("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 @@ impl<'a, 'v> Visitor<'v> for Context<'a> { 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);