]> git.lizzy.rs Git - rust.git/commitdiff
Finish de-implicit-selifizng libcore
authorBen Striegel <ben.striegel@gmail.com>
Wed, 6 Mar 2013 09:00:25 +0000 (04:00 -0500)
committerBen Striegel <ben.striegel@gmail.com>
Wed, 6 Mar 2013 09:00:25 +0000 (04:00 -0500)
src/libcore/core.rc
src/libcore/dvec.rs
src/libcore/hash.rs
src/libcore/unstable.rs
src/librustpkg/util.rs

index 54644281edf2cf993432df0b5137964db93ae611..ccfeb0de0e76ca4e4f43ccefa8212f76fda197f2 100644 (file)
@@ -50,7 +50,6 @@ Implicitly, all crates behave as if they included the following prologue:
 
 #[warn(vecs_implicitly_copyable)];
 #[deny(non_camel_case_types)];
-#[allow(deprecated_self)];
 #[allow(deprecated_mutable_fields)];
 
 /* The Prelude. */
index 7eb615d07a6fbe36ef69893960f5addb906726d4..43daf5fa6a5daa2332d6830b77cd3e69399b4413 100644 (file)
@@ -108,7 +108,7 @@ fn unwrap(self) -> ~[A] { unwrap(self) }
 pub impl<A> DVec<A> {
     // FIXME (#3758): This should not need to be public.
     #[inline(always)]
-    fn check_out<B>(f: &fn(v: ~[A]) -> B) -> B {
+    fn check_out<B>(&self, f: &fn(v: ~[A]) -> B) -> B {
         unsafe {
             let mut data = cast::reinterpret_cast(&null::<()>());
             data <-> self.data;
index 2587b84b274ca207d3bb83f82087e5df975cdea8..8f3f81d167e7fa78ce0a3199ecc74192a2eb6f90 100644 (file)
@@ -68,7 +68,7 @@ pub trait Streaming {
     fn input(&self, (&[const u8]));
     // These can be refactored some when we have default methods.
     fn result_bytes(&self) -> ~[u8];
-    fn result_str() -> ~str;
+    fn result_str(&self) -> ~str;
     fn result_u64(&self) -> u64;
     fn reset(&self);
 }
@@ -349,8 +349,7 @@ fn result_bytes(&self) -> ~[u8] {
         ]
     }
 
-    // IMPLICIT SELF WARNING: fix me!
-    fn result_str() -> ~str {
+    fn result_str(&self) -> ~str {
         let r = self.result_bytes();
         let mut s = ~"";
         for vec::each(r) |b| {
index dcec424f29000f41f18655b5a1ea4265c8e1d544..8169b957898ef2e804e1291db4496ec02e2cad64 100644 (file)
@@ -228,7 +228,7 @@ fn LittleLock() -> LittleLock {
 
 pub impl LittleLock {
     #[inline(always)]
-    unsafe fn lock<T>(f: fn() -> T) -> T {
+    unsafe fn lock<T>(&self, f: fn() -> T) -> T {
         struct Unlock {
             l: rust_little_lock,
             drop {
@@ -280,7 +280,7 @@ pub impl<T:Owned> Exclusive<T> {
     // accessing the provided condition variable) are prohibited while inside
     // the exclusive. Supporting that is a work in progress.
     #[inline(always)]
-    unsafe fn with<U>(f: fn(x: &mut T) -> U) -> U {
+    unsafe fn with<U>(&self, f: fn(x: &mut T) -> U) -> U {
         unsafe {
             let rec = get_shared_mutable_state(&self.x);
             do (*rec).lock.lock {
@@ -297,7 +297,7 @@ unsafe fn with<U>(f: fn(x: &mut T) -> U) -> U {
     }
 
     #[inline(always)]
-    unsafe fn with_imm<U>(f: fn(x: &T) -> U) -> U {
+    unsafe fn with_imm<U>(&self, f: fn(x: &T) -> U) -> U {
         do self.with |x| {
             f(cast::transmute_immut(x))
         }
index d7428ae15e7ef2dcb28629f2a9ec2e30971f9bc1..32f9593d9a630386f4f5f44e204bd0482fc893a2 100644 (file)
@@ -253,7 +253,7 @@ pub fn error(msg: ~str) {
 }
 
 pub fn hash(data: ~str) -> ~str {
-    let hasher = hash::default_state();
+    let hasher = &hash::default_state();
 
     hasher.write_str(data);
     hasher.result_str()