Skip to content

Commit

Permalink
Replace HashUtil w/ default method on Hash
Browse files Browse the repository at this point in the history
  • Loading branch information
jfager committed Aug 28, 2013
1 parent 58d6eb5 commit da559b2
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/librustc/metadata/decoder.rs
Expand Up @@ -25,7 +25,6 @@ use middle::typeck;
use middle::astencode::vtable_decoder_helpers;


use std::hash::HashUtil;
use std::u64;
use std::io::WriterUtil;
use std::io;
Expand Down
1 change: 0 additions & 1 deletion src/librustc/metadata/encoder.rs
Expand Up @@ -21,7 +21,6 @@ use middle::typeck;
use middle::astencode;
use middle;

use std::hash::HashUtil;
use std::hashmap::{HashMap, HashSet};
use std::io;
use std::str;
Expand Down
7 changes: 0 additions & 7 deletions src/libstd/hash.rs
Expand Up @@ -59,14 +59,7 @@ pub trait Hash {
* IterBytes trait, that feeds SipHash.
*/
fn hash_keyed(&self, k0: u64, k1: u64) -> u64;
}

// When we have default methods, won't need this.
pub trait HashUtil {
fn hash(&self) -> u64;
}

impl<A:Hash> HashUtil for A {
#[inline]
fn hash(&self) -> u64 { self.hash_keyed(0,0) }
}
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/deriving-meta-multiple.rs
Expand Up @@ -19,8 +19,6 @@ struct Foo {
}

pub fn main() {
use std::hash::HashUtil; // necessary for IterBytes check

let a = Foo {bar: 4, baz: -3};

a == a; // check for Eq impl w/o testing its correctness
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/deriving-meta.rs
Expand Up @@ -17,8 +17,6 @@ struct Foo {
}

pub fn main() {
use std::hash::HashUtil; // necessary for IterBytes check

let a = Foo {bar: 4, baz: -3};

a == a; // check for Eq impl w/o testing its correctness
Expand Down

5 comments on commit da559b2

@bors
Copy link
Contributor

@bors bors commented on da559b2 Aug 28, 2013

Choose a reason for hiding this comment

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

saw approval from alexcrichton
at jfager@da559b2

@bors
Copy link
Contributor

@bors bors commented on da559b2 Aug 28, 2013

Choose a reason for hiding this comment

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

merging jfager/rust/remove-hashutil = da559b2 into auto

@bors
Copy link
Contributor

@bors bors commented on da559b2 Aug 28, 2013

Choose a reason for hiding this comment

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

jfager/rust/remove-hashutil = da559b2 merged ok, testing candidate = 78c5f97

@bors
Copy link
Contributor

@bors bors commented on da559b2 Aug 28, 2013

@bors
Copy link
Contributor

@bors bors commented on da559b2 Aug 28, 2013

Choose a reason for hiding this comment

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

fast-forwarding master to auto = 78c5f97

Please sign in to comment.