diff options
| author | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2014-02-23 19:11:19 -0800 |
|---|---|---|
| committer | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2014-02-24 19:52:29 -0800 |
| commit | 922eb47a20c432e079444032f9ece9a5a39f2080 (patch) | |
| tree | af2e641d88ccd25a348d0f0773c076950328a27e /src | |
| parent | 848cbb4e130d7ec9609b36b3f6f7a68099cbd6a7 (diff) | |
| download | rust-922eb47a20c432e079444032f9ece9a5a39f2080.tar.gz rust-922eb47a20c432e079444032f9ece9a5a39f2080.zip | |
test: Use `#[deriving(Hash)]` in a couple tests
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/run-pass/deriving-global.rs | 3 | ||||
| -rw-r--r-- | src/test/run-pass/deriving-meta-multiple.rs | 6 | ||||
| -rw-r--r-- | src/test/run-pass/deriving-meta.rs | 5 |
3 files changed, 11 insertions, 3 deletions
diff --git a/src/test/run-pass/deriving-global.rs b/src/test/run-pass/deriving-global.rs index cce3575178e..af60a35cbf8 100644 --- a/src/test/run-pass/deriving-global.rs +++ b/src/test/run-pass/deriving-global.rs @@ -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)] diff --git a/src/test/run-pass/deriving-meta-multiple.rs b/src/test/run-pass/deriving-meta-multiple.rs index 58ec8e35281..069f50f89f4 100644 --- a/src/test/run-pass/deriving-meta-multiple.rs +++ b/src/test/run-pass/deriving-meta-multiple.rs @@ -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 } diff --git a/src/test/run-pass/deriving-meta.rs b/src/test/run-pass/deriving-meta.rs index 7f31aa586cc..069f50f89f4 100644 --- a/src/test/run-pass/deriving-meta.rs +++ b/src/test/run-pass/deriving-meta.rs @@ -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 } |
