Skip to content

Commit 660cf18

Browse files
committed
Move while let behind while_let feature gate
1 parent b003f10 commit 660cf18

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/doc/reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,6 +2503,8 @@ The currently implemented features of the reference compiler are:
25032503

25042504
* `if_let` - Allows use of the `if let` syntax.
25052505

2506+
* `while_let` - Allows use of the `while let` syntax.
2507+
25062508
* `intrinsics` - Allows use of the "rust-intrinsics" ABI. Compiler intrinsics
25072509
are inherently unstable and no promise about them is made.
25082510

src/libsyntax/feature_gate.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
7373
("slicing_syntax", Active),
7474

7575
("if_let", Active),
76+
("while_let", Active),
7677

7778
// if you change this list without updating src/doc/reference.md, cmr will be sad
7879

@@ -356,6 +357,10 @@ impl<'a, 'v> Visitor<'v> for Context<'a> {
356357
e.span,
357358
"slicing syntax is experimental");
358359
}
360+
ast::ExprWhileLet(..) => {
361+
self.gate_feature("while_let", e.span,
362+
"`while let` syntax is experimental");
363+
}
359364
_ => {}
360365
}
361366
visit::walk_expr(self, e);

0 commit comments

Comments
 (0)