about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorFlavio Percoco <flaper87@gmail.com>2014-12-29 13:52:43 +0100
committerFlavio Percoco <flaper87@gmail.com>2015-01-04 23:16:14 +0100
commitc062fac835e64c1ebf71da784714de562eac732c (patch)
tree3075cf76bce0387becc1d852354303b45fbf72ab /src/libsyntax
parent8b883ab2681e34ef94575f45c6c0e6c2bca23ab7 (diff)
downloadrust-c062fac835e64c1ebf71da784714de562eac732c.tar.gz
rust-c062fac835e64c1ebf71da784714de562eac732c.zip
Put negative trait implemtations behind a feature gate
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/feature_gate.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 29f8ff9e812..f8ac34cfe29 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -84,6 +84,9 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
     // A way to temporarily opt out of the new orphan rules. This will *never* be accepted.
     ("old_orphan_check", Deprecated),
 
+    // OIBIT specific features
+    ("optin_builtin_traits", Active),
+
     // These are used to test this portion of the compiler, they don't actually
     // mean anything
     ("test_accepted_feature", Accepted),
@@ -291,7 +294,17 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
                 }
             }
 
-            ast::ItemImpl(_, _, _, _, _, ref items) => {
+            ast::ItemImpl(_, polarity, _, _, _, ref items) => {
+                match polarity {
+                    ast::ImplPolarity::Negative => {
+                        self.gate_feature("optin_builtin_traits",
+                                          i.span,
+                                          "negative trait bounds are not yet fully implemented; \
+                                          use marker types for now");
+                    },
+                    _ => {}
+                }
+
                 if attr::contains_name(i.attrs[],
                                        "unsafe_destructor") {
                     self.gate_feature("unsafe_destructor",