diff options
| author | bors <bors@rust-lang.org> | 2015-02-11 15:00:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-11 15:00:35 +0000 |
| commit | 446bc899b28e988f4252beca0d1858e7f7d866b1 (patch) | |
| tree | 8f5c4e248e34374d8b863a6e97e13ca9d9e50b64 /src/libsyntax | |
| parent | 1500df8934431dd7842827209528211ae53ded12 (diff) | |
| parent | cdd8a5ad743338d246e3db31ab0b5b0d448a2146 (diff) | |
| download | rust-446bc899b28e988f4252beca0d1858e7f7d866b1.tar.gz rust-446bc899b28e988f4252beca0d1858e7f7d866b1.zip | |
Auto merge of #22175 - pnkfelix:featuregate-boxpat-rfc469, r=nikomatsakis
Feature gate `box` patterns. Note that this adds a new feature gate, `box_patterns` specific to e.g. `let box i = ...`, while leaving `box` expressions (alone) still guarded via the preexisting `box_syntax`.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 9 | ||||
| -rw-r--r-- | src/libsyntax/lib.rs | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 72bbe1adfaa..1a328f87c19 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -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 { @@ -427,7 +430,7 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { ast::ExprBox(..) | ast::ExprUnary(ast::UnOp::UnUniq, _) => { self.gate_feature("box_syntax", e.span, - "box expression syntax is experimental in alpha release; \ + "box expression syntax is experimental; \ you can call `Box::new` instead."); } ast::ExprLit(ref lit) => { @@ -486,9 +489,9 @@ 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"); + "box pattern syntax is experimental"); } _ => {} } diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 41850ada3e6..951e4dcf792 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -23,6 +23,7 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/nightly/")] +#![feature(box_patterns)] #![feature(box_syntax)] #![feature(collections)] #![feature(core)] |
