summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-01-28 10:46:43 -0800
committerPatrick Walton <pcwalton@mimiga.net>2013-01-29 10:42:58 -0800
commit6ce74460e6a5c8045a7b43b86a656f28354f4b0c (patch)
treea09e6a6b8ba8566e6dc9f223d6cbbfbbdcde19e2 /src/libsyntax/parse
parenteb4d39e1fef918242a5dba2a09d7b9faa437b911 (diff)
downloadrust-6ce74460e6a5c8045a7b43b86a656f28354f4b0c.tar.gz
rust-6ce74460e6a5c8045a7b43b86a656f28354f4b0c.zip
librustc: Disallow trait bounds in types, enumerations, and structure definitions. r=tjc
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/obsolete.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs
index 67f6c4bed3f..86dea693f8a 100644
--- a/src/libsyntax/parse/obsolete.rs
+++ b/src/libsyntax/parse/obsolete.rs
@@ -33,6 +33,7 @@ use core::str;
 use core::to_bytes;
 
 /// The specific types of unsupported syntax
+#[deriving_eq]
 pub enum ObsoleteSyntax {
     ObsoleteLowerCaseKindBounds,
     ObsoleteLet,
@@ -45,16 +46,8 @@ pub enum ObsoleteSyntax {
     ObsoleteModeInFnType,
     ObsoleteMoveInit,
     ObsoleteBinaryMove,
-    ObsoleteUnsafeBlock
-}
-
-impl ObsoleteSyntax : cmp::Eq {
-    pure fn eq(&self, other: &ObsoleteSyntax) -> bool {
-        (*self) as uint == (*other) as uint
-    }
-    pure fn ne(&self, other: &ObsoleteSyntax) -> bool {
-        !(*self).eq(other)
-    }
+    ObsoleteUnsafeBlock,
+    ObsoleteUnenforcedBound
 }
 
 impl ObsoleteSyntax: to_bytes::IterBytes {
@@ -123,6 +116,11 @@ impl Parser {
             ObsoleteUnsafeBlock => (
                 "non-standalone unsafe block",
                 "use an inner `unsafe { ... }` block instead"
+            ),
+            ObsoleteUnenforcedBound => (
+                "unenforced type parameter bound",
+                "use trait bounds on the functions that take the type as \
+                 arguments, not on the types themselves"
             )
         };