Skip to content

Commit

Permalink
Move while let behind while_let feature gate
Browse files Browse the repository at this point in the history
  • Loading branch information
hydhknn committed Oct 11, 2014
1 parent b003f10 commit 660cf18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/doc/reference.md
Expand Up @@ -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.

Expand Down
5 changes: 5 additions & 0 deletions src/libsyntax/feature_gate.rs
Expand Up @@ -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

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 660cf18

Please sign in to comment.