summary refs log tree commit diff
path: root/src/libcore/ops.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-07-27 19:32:42 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-07-27 19:35:24 -0700
commit93c2f5e0e43532a2288ed6dec378564264d1a77c (patch)
tree2d8d3f5d4667f7a009fa338bc34076216873b35c /src/libcore/ops.rs
parente6d2e49852873c52b872185a0ae5a8ca941ed2f1 (diff)
rustc: Use coherence for operator overloading.
The only use of the old-style impls is now placement new.
Diffstat (limited to 'src/libcore/ops.rs')
-rw-r--r--src/libcore/ops.rs50
1 files changed, 41 insertions, 9 deletions
diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs
index 61efe704974..2a05aeb72c2 100644
--- a/src/libcore/ops.rs
+++ b/src/libcore/ops.rs
@@ -1,64 +1,96 @@
 // Core operators and kinds.
 
+#[cfg(notest)]
 #[lang="const"]
 trait const {
     // Empty.
 }
 
+#[cfg(notest)]
 #[lang="copy"]
 trait copy {
     // Empty.
 }
 
+#[cfg(notest)]
 #[lang="send"]
 trait send {
     // Empty.
 }
 
+#[cfg(notest)]
 #[lang="owned"]
 trait owned {
     // Empty.
 }
 
+#[cfg(notest)]
 #[lang="add"]
 trait add<RHS,Result> {
     pure fn add(rhs: RHS) -> Result;
 }
 
+#[cfg(notest)]
 #[lang="sub"]
 trait sub<RHS,Result> {
     pure fn sub(rhs: RHS) -> Result;
 }
 
+#[cfg(notest)]
 #[lang="mul"]
 trait mul<RHS,Result> {
     pure fn mul(rhs: RHS) -> Result;
 }
 
+#[cfg(notest)]
 #[lang="div"]
 trait div<RHS,Result> {
     pure fn div(rhs: RHS) -> Result;
 }
 
+#[cfg(notest)]
 #[lang="modulo"]
 trait modulo<RHS,Result> {
     pure fn modulo(rhs: RHS) -> Result;
 }
 
+#[cfg(notest)]
 #[lang="neg"]
-trait neg<RHS,Result> {
-    pure fn neg(rhs: RHS) -> Result;
+trait neg<Result> {
+    pure fn neg() -> Result;
 }
 
-#[lang="bitops"]
-trait bitops<RHS,BitCount,Result> {
-    pure fn and(rhs: RHS) -> Result;
-    pure fn or(rhs: RHS) -> Result;
-    pure fn xor(rhs: RHS) -> Result;
-    pure fn shl(n: BitCount) -> Result;
-    pure fn shr(n: BitCount) -> Result;
+#[cfg(notest)]
+#[lang="bitand"]
+trait bitand<RHS,Result> {
+    pure fn bitand(rhs: RHS) -> Result;
 }
 
+#[cfg(notest)]
+#[lang="bitor"]
+trait bitor<RHS,Result> {
+    pure fn bitor(rhs: RHS) -> Result;
+}
+
+#[cfg(notest)]
+#[lang="bitxor"]
+trait bitxor<RHS,Result> {
+    pure fn bitxor(rhs: RHS) -> Result;
+}
+
+#[cfg(notest)]
+#[lang="shl"]
+trait shl<RHS,Result> {
+    pure fn shl(rhs: RHS) -> Result;
+}
+
+#[cfg(notest)]
+#[lang="shr"]
+trait shr<RHS,Result> {
+    pure fn shr(rhs: RHS) -> Result;
+}
+
+#[cfg(notest)]
 #[lang="index"]
 trait index<Index,Result> {
     pure fn index(index: Index) -> Result;