Transition to new Hash, removing IterBytes and std::to_bytes.

This commit is contained in:
Huon Wilson 2014-02-23 21:29:35 +11:00
parent 5444da54fd
commit efaf4db24c
50 changed files with 286 additions and 1321 deletions

View file

@ -27,21 +27,18 @@ mod submod {
// function calls, then being in a submodule will (correctly)
// cause errors about unrecognised module `std` (or `extra`)
#[deriving(Eq, Ord, TotalEq, TotalOrd,
IterBytes,
Clone, DeepClone,
ToStr, Rand,
Encodable, Decodable)]
enum A { A1(uint), A2(int) }
#[deriving(Eq, Ord, TotalEq, TotalOrd,
IterBytes,
Clone, DeepClone,
ToStr, Rand,
Encodable, Decodable)]
struct B { x: uint, y: int }
#[deriving(Eq, Ord, TotalEq, TotalOrd,
IterBytes,
Clone, DeepClone,
ToStr, Rand,
Encodable, Decodable)]

View file

@ -10,11 +10,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::hash_old::Hash;
#[deriving(Eq)]
#[deriving(Clone)]
#[deriving(IterBytes)]
struct Foo {
bar: uint,
baz: int
@ -25,5 +22,4 @@ pub fn main() {
a == a; // check for Eq impl w/o testing its correctness
a.clone(); // check for Clone impl w/o testing its correctness
a.hash(); // check for IterBytes impl w/o testing its correctness
}

View file

@ -10,9 +10,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::hash_old::Hash;
#[deriving(Eq, Clone, IterBytes)]
#[deriving(Eq, Clone)]
struct Foo {
bar: uint,
baz: int
@ -23,5 +21,4 @@ pub fn main() {
a == a; // check for Eq impl w/o testing its correctness
a.clone(); // check for Clone impl w/o testing its correctness
a.hash(); // check for IterBytes impl w/o testing its correctness
}

View file

@ -10,13 +10,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving(IterBytes)]
#[deriving(Hash)]
enum Foo {
Bar(int, char),
Baz(char, int)
}
#[deriving(IterBytes)]
#[deriving(Hash)]
enum A {
B,
C,

View file

@ -10,7 +10,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving(IterBytes)]
#[deriving(Hash)]
struct Foo {
x: int,
y: int,

View file

@ -11,7 +11,7 @@
// except according to those terms.
#[deriving(Eq)]
#[deriving(IterBytes)]
#[deriving(Hash)]
struct Foo<T> {
x: int,
y: T,

View file

@ -85,7 +85,7 @@ impl<'tcx,'ast> TypeContext<'tcx, 'ast> {
}
}
#[deriving(Eq, IterBytes)]
#[deriving(Eq, Hash)]
struct NodeId {
id: uint
}

View file

@ -15,7 +15,7 @@
extern crate other1 = "typeid-intrinsic";
extern crate other2 = "typeid-intrinsic2";
use std::hash_old::Hash;
use std::hash;
use std::intrinsics;
use std::intrinsics::TypeId;
@ -71,5 +71,5 @@ pub fn main() {
// check it has a hash
let (a, b) = (TypeId::of::<uint>(), TypeId::of::<uint>());
assert_eq!(a.hash(), b.hash());
assert_eq!(hash::hash(&a), hash::hash(&b));
}