test: Use #[deriving(Hash)] in a couple tests

This commit is contained in:
Erick Tryzelaar 2014-02-23 19:11:19 -08:00
parent 848cbb4e13
commit 922eb47a20
3 changed files with 11 additions and 3 deletions

View File

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

View File

@ -10,8 +10,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving(Eq)]
#[deriving(Clone)]
use std::hash::hash;
#[deriving(Eq, Clone, Hash)]
struct Foo {
bar: uint,
baz: int
@ -22,4 +23,5 @@ 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
hash(&a); // check for Hash impl w/o testing its correctness
}

View File

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