about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-09-02 18:13:48 -0700
committerBrian Anderson <banderson@mozilla.com>2012-09-02 18:13:56 -0700
commitf393100b7ce86e0c1201f003c2d69fb9ea742db1 (patch)
tree577bd91894ec1e1607ae805c03a36b0819617490
parentcb0eb66672c20404cc87850db98fe00ff94da403 (diff)
downloadrust-f393100b7ce86e0c1201f003c2d69fb9ea742db1.tar.gz
rust-f393100b7ce86e0c1201f003c2d69fb9ea742db1.zip
Camel case core::ops
-rw-r--r--src/libcore/at_vec.rs2
-rw-r--r--src/libcore/core.rs18
-rw-r--r--src/libcore/dvec.rs2
-rw-r--r--src/libcore/ops.rs34
-rw-r--r--src/libcore/str.rs2
-rw-r--r--src/libcore/vec.rs4
-rw-r--r--src/libstd/bitv.rs2
-rw-r--r--src/libstd/ebml.rs2
-rw-r--r--src/libstd/map.rs2
-rw-r--r--src/libstd/smallintmap.rs2
-rw-r--r--src/rustc/middle/ty.rs6
-rw-r--r--src/test/bench/shootout-mandelbrot.rs4
-rw-r--r--src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs2
-rw-r--r--src/test/run-pass/operator-overloading.rs8
14 files changed, 44 insertions, 46 deletions
diff --git a/src/libcore/at_vec.rs b/src/libcore/at_vec.rs
index 54f3ff0fc82..aa937328486 100644
--- a/src/libcore/at_vec.rs
+++ b/src/libcore/at_vec.rs
@@ -133,7 +133,7 @@ pure fn from_elem<T: copy>(n_elts: uint, t: T) -> @[T] {
 }
 
 #[cfg(notest)]
-impl<T: copy> @[T]: add<&[const T],@[T]> {
+impl<T: copy> @[T]: Add<&[const T],@[T]> {
     #[inline(always)]
     pure fn add(rhs: &[const T]) -> @[T] {
         append(self, rhs)
diff --git a/src/libcore/core.rs b/src/libcore/core.rs
index 4d875e45796..a6ac68c1882 100644
--- a/src/libcore/core.rs
+++ b/src/libcore/core.rs
@@ -44,28 +44,28 @@ export ToStr;
 // The compiler has special knowlege of these so we must not duplicate them
 // when compiling for testing
 #[cfg(notest)]
-import ops::{const, copy, send, owned};
+import ops::{Const, Copy, Send, Owned};
 #[cfg(notest)]
-import ops::{add, sub, mul, div, modulo, neg, bitand, bitor, bitxor};
+import ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
 #[cfg(notest)]
-import ops::{shl, shr, index};
+import ops::{Shl, Shr, Index};
 
 #[cfg(notest)]
-export const, copy, send, owned;
+export Const, Copy, Send, Owned;
 #[cfg(notest)]
-export add, sub, mul, div, modulo, neg, bitand, bitor, bitxor;
+export Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor;
 #[cfg(notest)]
-export shl, shr, index;
+export Shl, Shr, Index;
 
 #[cfg(test)]
 use coreops(name = "core", vers = "0.4");
 
 #[cfg(test)]
-import coreops::ops::{const, copy, send, owned};
+import coreops::ops::{Const, Copy, Send, Owned};
 #[cfg(test)]
-import coreops::ops::{add, sub, mul, div, modulo, neg, bitand, bitor, bitxor};
+import coreops::ops::{Add, Sub, Mul, Div, Modulo, Neg, BitAnd, BitOr, BitXor};
 #[cfg(test)]
-import coreops::ops::{shl, shr, index};
+import coreops::ops::{Shl, Shr, Index};
 
 
 // Export the log levels as global constants. Higher levels mean
diff --git a/src/libcore/dvec.rs b/src/libcore/dvec.rs
index 0fffec961df..af2a45d4267 100644
--- a/src/libcore/dvec.rs
+++ b/src/libcore/dvec.rs
@@ -327,7 +327,7 @@ impl<A: copy> DVec<A> {
     }
 }
 
-impl<A:copy> DVec<A>: index<uint,A> {
+impl<A:copy> DVec<A>: Index<uint,A> {
     pure fn index(&&idx: uint) -> A {
         self.get_elt(idx)
     }
diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs
index 07096968f4c..4e8b36a43fb 100644
--- a/src/libcore/ops.rs
+++ b/src/libcore/ops.rs
@@ -1,100 +1,98 @@
 // Core operators and kinds.
 
-#[allow(non_camel_case_types)];
-
 #[cfg(notest)]
 #[lang="const"]
-trait const {
+trait Const {
     // Empty.
 }
 
 #[cfg(notest)]
 #[lang="copy"]
-trait copy {
+trait Copy {
     // Empty.
 }
 
 #[cfg(notest)]
 #[lang="send"]
-trait send {
+trait Send {
     // Empty.
 }
 
 #[cfg(notest)]
 #[lang="owned"]
-trait owned {
+trait Owned {
     // Empty.
 }
 
 #[cfg(notest)]
 #[lang="add"]
-trait add<RHS,Result> {
+trait Add<RHS,Result> {
     pure fn add(rhs: RHS) -> Result;
 }
 
 #[cfg(notest)]
 #[lang="sub"]
-trait sub<RHS,Result> {
+trait Sub<RHS,Result> {
     pure fn sub(rhs: RHS) -> Result;
 }
 
 #[cfg(notest)]
 #[lang="mul"]
-trait mul<RHS,Result> {
+trait Mul<RHS,Result> {
     pure fn mul(rhs: RHS) -> Result;
 }
 
 #[cfg(notest)]
 #[lang="div"]
-trait div<RHS,Result> {
+trait Div<RHS,Result> {
     pure fn div(rhs: RHS) -> Result;
 }
 
 #[cfg(notest)]
 #[lang="modulo"]
-trait modulo<RHS,Result> {
+trait Modulo<RHS,Result> {
     pure fn modulo(rhs: RHS) -> Result;
 }
 
 #[cfg(notest)]
 #[lang="neg"]
-trait neg<Result> {
+trait Neg<Result> {
     pure fn neg() -> Result;
 }
 
 #[cfg(notest)]
 #[lang="bitand"]
-trait bitand<RHS,Result> {
+trait BitAnd<RHS,Result> {
     pure fn bitand(rhs: RHS) -> Result;
 }
 
 #[cfg(notest)]
 #[lang="bitor"]
-trait bitor<RHS,Result> {
+trait BitOr<RHS,Result> {
     pure fn bitor(rhs: RHS) -> Result;
 }
 
 #[cfg(notest)]
 #[lang="bitxor"]
-trait bitxor<RHS,Result> {
+trait BitXor<RHS,Result> {
     pure fn bitxor(rhs: RHS) -> Result;
 }
 
 #[cfg(notest)]
 #[lang="shl"]
-trait shl<RHS,Result> {
+trait Shl<RHS,Result> {
     pure fn shl(rhs: RHS) -> Result;
 }
 
 #[cfg(notest)]
 #[lang="shr"]
-trait shr<RHS,Result> {
+trait Shr<RHS,Result> {
     pure fn shr(rhs: RHS) -> Result;
 }
 
 #[cfg(notest)]
 #[lang="index"]
-trait index<Index,Result> {
+trait Index<Index,Result> {
     pure fn index(index: Index) -> Result;
 }
 
diff --git a/src/libcore/str.rs b/src/libcore/str.rs
index 800b4a130e6..b3f58ce2558 100644
--- a/src/libcore/str.rs
+++ b/src/libcore/str.rs
@@ -2065,7 +2065,7 @@ impl ~str: UniqueStr {
 }
 
 #[cfg(notest)]
-impl ~str: add<&str,~str> {
+impl ~str: Add<&str,~str> {
     #[inline(always)]
     pure fn add(rhs: &str) -> ~str {
         append(copy self, rhs)
diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs
index 680eb1e2dcb..5242505565a 100644
--- a/src/libcore/vec.rs
+++ b/src/libcore/vec.rs
@@ -1480,14 +1480,14 @@ impl<T: Ord> @[T]: Ord {
 }
 
 #[cfg(notest)]
-impl<T: copy> ~[T]: add<&[const T],~[T]> {
+impl<T: copy> ~[T]: Add<&[const T],~[T]> {
     #[inline(always)]
     pure fn add(rhs: &[const T]) -> ~[T] {
         append(copy self, rhs)
     }
 }
 
-impl<T: copy> ~[mut T]: add<&[const T],~[mut T]> {
+impl<T: copy> ~[mut T]: Add<&[const T],~[mut T]> {
     #[inline(always)]
     pure fn add(rhs: &[const T]) -> ~[mut T] {
         append_mut(self, rhs)
diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs
index 5d21461eb49..da622625959 100644
--- a/src/libstd/bitv.rs
+++ b/src/libstd/bitv.rs
@@ -469,7 +469,7 @@ pure fn land(w0: uint, w1: uint) -> uint { return w0 & w1; }
 
 pure fn right(_w0: uint, w1: uint) -> uint { return w1; }
 
-impl Bitv: ops::index<uint,bool> {
+impl Bitv: ops::Index<uint,bool> {
     pure fn index(&&i: uint) -> bool {
         self.get(i)
     }
diff --git a/src/libstd/ebml.rs b/src/libstd/ebml.rs
index 8f9987be348..71de166795f 100644
--- a/src/libstd/ebml.rs
+++ b/src/libstd/ebml.rs
@@ -41,7 +41,7 @@ type Doc = {data: @~[u8], start: uint, end: uint};
 
 type TaggedDoc = {tag: uint, doc: Doc};
 
-impl Doc: ops::index<uint,Doc> {
+impl Doc: ops::Index<uint,Doc> {
     pure fn index(&&tag: uint) -> Doc {
         unchecked {
             get_doc(self, tag)
diff --git a/src/libstd/map.rs b/src/libstd/map.rs
index 9e2770a1f02..20c48d6dda7 100644
--- a/src/libstd/map.rs
+++ b/src/libstd/map.rs
@@ -367,7 +367,7 @@ mod chained {
         }
     }
 
-    impl<K: copy, V: copy> t<K, V>: ops::index<K, V> {
+    impl<K: copy, V: copy> t<K, V>: ops::Index<K, V> {
         pure fn index(&&k: K) -> V {
             unchecked {
                 self.get(k)
diff --git a/src/libstd/smallintmap.rs b/src/libstd/smallintmap.rs
index bc830b4fd9c..4535344b968 100644
--- a/src/libstd/smallintmap.rs
+++ b/src/libstd/smallintmap.rs
@@ -134,7 +134,7 @@ impl<V: copy> smallintmap<V>: map::map<uint, V> {
     }
 }
 
-impl<V: copy> smallintmap<V>: ops::index<uint, V> {
+impl<V: copy> smallintmap<V>: ops::Index<uint, V> {
     pure fn index(&&key: uint) -> V {
         unchecked {
             get(self, key)
diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs
index 1d28e035141..d467f3b5be5 100644
--- a/src/rustc/middle/ty.rs
+++ b/src/rustc/middle/ty.rs
@@ -1605,7 +1605,7 @@ fn remove_copyable(k: kind) -> kind {
     k - kind_(KIND_MASK_COPY | KIND_MASK_DEFAULT_MODE)
 }
 
-impl kind: ops::bitand<kind,kind> {
+impl kind: ops::BitAnd<kind,kind> {
     pure fn bitand(other: kind) -> kind {
         unchecked {
             lower_kind(self, other)
@@ -1613,7 +1613,7 @@ impl kind: ops::bitand<kind,kind> {
     }
 }
 
-impl kind: ops::bitor<kind,kind> {
+impl kind: ops::BitOr<kind,kind> {
     pure fn bitor(other: kind) -> kind {
         unchecked {
             raise_kind(self, other)
@@ -1621,7 +1621,7 @@ impl kind: ops::bitor<kind,kind> {
     }
 }
 
-impl kind: ops::sub<kind,kind> {
+impl kind: ops::Sub<kind,kind> {
     pure fn sub(other: kind) -> kind {
         unchecked {
             kind_(*self & !*other)
diff --git a/src/test/bench/shootout-mandelbrot.rs b/src/test/bench/shootout-mandelbrot.rs
index fc011952be3..d203e7578b8 100644
--- a/src/test/bench/shootout-mandelbrot.rs
+++ b/src/test/bench/shootout-mandelbrot.rs
@@ -21,7 +21,7 @@ struct cmplx {
     im: f64;
 }
 
-impl cmplx : ops::mul<cmplx,cmplx> {
+impl cmplx : ops::Mul<cmplx,cmplx> {
     pure fn mul(x: cmplx) -> cmplx {
         cmplx {
             re: self.re*x.re - self.im*x.im,
@@ -30,7 +30,7 @@ impl cmplx : ops::mul<cmplx,cmplx> {
     }
 }
 
-impl cmplx : ops::add<cmplx,cmplx> {
+impl cmplx : ops::Add<cmplx,cmplx> {
     pure fn add(x: cmplx) -> cmplx {
         cmplx {
             re: self.re + x.re,
diff --git a/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs b/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs
index ecaad792fb9..dcaa53d37fc 100644
--- a/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs
+++ b/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs
@@ -3,7 +3,7 @@ struct Point {
     y: int;
 }
 
-impl Point : ops::add<int,int> {
+impl Point : ops::Add<int,int> {
     pure fn add(&&z: int) -> int {
         self.x + self.y + z
     }
diff --git a/src/test/run-pass/operator-overloading.rs b/src/test/run-pass/operator-overloading.rs
index 9ba91ee67d3..92bde631fcf 100644
--- a/src/test/run-pass/operator-overloading.rs
+++ b/src/test/run-pass/operator-overloading.rs
@@ -3,25 +3,25 @@ struct Point {
     y: int;
 }
 
-impl Point : ops::add<Point,Point> {
+impl Point : ops::Add<Point,Point> {
     pure fn add(other: Point) -> Point {
         Point {x: self.x + other.x, y: self.y + other.y}
     }
 }
 
-impl Point : ops::sub<Point,Point> {
+impl Point : ops::Sub<Point,Point> {
     pure fn sub(other: Point) -> Point {
         Point {x: self.x - other.x, y: self.y - other.y}
     }
 }
 
-impl Point : ops::neg<Point> {
+impl Point : ops::Neg<Point> {
     pure fn neg() -> Point {
         Point {x: -self.x, y: -self.y}
     }
 }
 
-impl Point : ops::index<bool,int> {
+impl Point : ops::Index<bool,int> {
     pure fn index(&&x: bool) -> int {
         if x { self.x } else { self.y }
     }