diff options
| author | Aaron Turon <aturon@mozilla.com> | 2015-12-30 15:16:43 -0800 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2016-03-14 15:04:38 -0700 |
| commit | e81691039854e678381042ce93e13bee6971c3d9 (patch) | |
| tree | 7f6319b1134f640f445be2d49423bfa8e0988bff /src/libsyntax | |
| parent | 9f16c2ce59ac942e1c0415987012100756a44039 (diff) | |
| download | rust-e81691039854e678381042ce93e13bee6971c3d9.tar.gz rust-e81691039854e678381042ce93e13bee6971c3d9.zip | |
Add feature gate
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 14a3f93738a..d50eb17c87b 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -248,6 +248,9 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Option<u32>, Status // `expr?` ("question_mark", "1.9.0", Some(31436), Active) + + // impl specialization (RFC 1210) + ("specialization", "1.7.0", None, Active), ]; // (changing above list without updating src/doc/reference.md makes @cmr sad) @@ -574,6 +577,7 @@ pub struct Features { pub stmt_expr_attributes: bool, pub deprecated: bool, pub question_mark: bool, + pub specialization: bool, } impl Features { @@ -608,6 +612,7 @@ impl Features { stmt_expr_attributes: false, deprecated: false, question_mark: false, + specialization: false, } } } @@ -1102,6 +1107,12 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { } fn visit_impl_item(&mut self, ii: &'v ast::ImplItem) { + if ii.defaultness == ast::Defaultness::Default { + self.gate_feature("specialization", + ii.span, + "specialization is unstable"); + } + match ii.node { ast::ImplItemKind::Const(..) => { self.gate_feature("associated_consts", @@ -1212,6 +1223,7 @@ fn check_crate_inner<F>(cm: &CodeMap, span_handler: &Handler, stmt_expr_attributes: cx.has_feature("stmt_expr_attributes"), deprecated: cx.has_feature("deprecated"), question_mark: cx.has_feature("question_mark"), + specialization: cx.has_feature("specialization"), } } |
