test: Use #[deriving(Hash)]
in a couple tests
This commit is contained in:
parent
848cbb4e13
commit
922eb47a20
@ -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)]
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user