Skip to content

Commit 105f70b

Browse files
committed
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]
1 parent 5936278 commit 105f70b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libsyntax/feature_gate.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ static KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
126126

127127
// Allows using #![no_std]
128128
("no_std", "1.0.0", Active),
129+
130+
// Allows using `box` in patterns; RFC 469
131+
("box_patterns", "1.0.0", Active),
129132
];
130133

131134
enum Status {
@@ -486,7 +489,7 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
486489
`[0, ..xs, 0]` are experimental")
487490
}
488491
ast::PatBox(..) => {
489-
self.gate_feature("box_syntax",
492+
self.gate_feature("box_patterns",
490493
pattern.span,
491494
"box pattern syntax is experimental in alpha release");
492495
}

0 commit comments

Comments
 (0)