mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
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:
parent
5936278ed6
commit
105f70b500
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user