about summary refs log tree commit diff
path: root/src/libstd/time
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2017-12-20 21:21:58 +0800
committerGitHub <noreply@github.com>2017-12-20 21:21:58 +0800
commit5e98112af4e8b4068bcee6a54e28031fc92d6a3f (patch)
tree5d79493d556f052fb6954cc08a593e272b2faea2 /src/libstd/time
parentf35bb15fc6fc764af9d97b240b133343b82a7e24 (diff)
parent1d5ead453dd96c1040a12cbb3b0180027af165c9 (diff)
downloadrust-5e98112af4e8b4068bcee6a54e28031fc92d6a3f.tar.gz
rust-5e98112af4e8b4068bcee6a54e28031fc92d6a3f.zip
Rollup merge of #46828 - vi:hash_for_systemtime_instant, r=dtolnay
Add Hash impl for SystemTime and Instant

Closes #46670.

Not sure how to actually test non-Linux platforms.
`rustc --target=i686-pc-windows-gnu --crate-name std --crate-type rlib src/libstd/lib.rs -o q.rlib` works a bit, but for Redox I'm not sure what to do.

r? @dtolnay
Diffstat (limited to 'src/libstd/time')
-rw-r--r--src/libstd/time/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/time/mod.rs b/src/libstd/time/mod.rs
index d4993ded843..6ce3b3e8a00 100644
--- a/src/libstd/time/mod.rs
+++ b/src/libstd/time/mod.rs
@@ -66,7 +66,7 @@ mod duration;
 ///    println!("{}", now.elapsed().as_secs());
 /// }
 /// ```
-#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
+#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 #[stable(feature = "time2", since = "1.8.0")]
 pub struct Instant(time::Instant);
 
@@ -118,7 +118,7 @@ pub struct Instant(time::Instant);
 ///    }
 /// }
 /// ```
-#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
+#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 #[stable(feature = "time2", since = "1.8.0")]
 pub struct SystemTime(time::SystemTime);