Add `box_patterns` feature gate.

Switch feature-gate checker from `box_syntax` to `box_patterns` when
visiting a pattern.

(Having to opt into both `box_syntax` and `box_patterns` seemed
unnecessary.)

[breaking-change]
This commit is contained in:
Felix S. Klock II 2015-02-10 22:49:56 +01:00
parent 5936278ed6
commit 105f70b500
1 changed files with 4 additions and 1 deletions

View File

@ -126,6 +126,9 @@ static KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
// Allows using #![no_std]
("no_std", "1.0.0", Active),
// Allows using `box` in patterns; RFC 469
("box_patterns", "1.0.0", Active),
];
enum Status {
@ -486,7 +489,7 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
`[0, ..xs, 0]` are experimental")
}
ast::PatBox(..) => {
self.gate_feature("box_syntax",
self.gate_feature("box_patterns",
pattern.span,
"box pattern syntax is experimental in alpha release");
}