Skip to content

Commit

Permalink
Finish de-implicit-selifizng libcore
Browse files Browse the repository at this point in the history
  • Loading branch information
bstrie committed Mar 6, 2013
1 parent 959e483 commit 12f06bb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/libcore/core.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/dvec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ priv impl<A> DVec<A> {
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;
Expand Down
5 changes: 2 additions & 3 deletions src/libcore/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -349,8 +349,7 @@ impl Streaming for &SipState {
]
}

// 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| {
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -297,7 +297,7 @@ pub impl<T:Owned> Exclusive<T> {
}

#[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))
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustpkg/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

5 comments on commit 12f06bb

@bors
Copy link
Contributor

@bors bors commented on 12f06bb Mar 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from pcwalton
at bstrie@12f06bb

@bors
Copy link
Contributor

@bors bors commented on 12f06bb Mar 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging bstrie/rust/deimpselfcore2 = 12f06bb into auto

@bors
Copy link
Contributor

@bors bors commented on 12f06bb Mar 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bstrie/rust/deimpselfcore2 = 12f06bb merged ok, testing candidate = 67100dd

@bors
Copy link
Contributor

@bors bors commented on 12f06bb Mar 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 12f06bb Mar 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = 67100dd

Please sign in to comment.