diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2019-03-20 19:04:38 +0100 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2019-03-20 19:04:38 +0100 |
| commit | c1d9191fa576c600775b4fbb90a3d09ca5e0fa0b (patch) | |
| tree | 687eb569be21bf9e6238af733dad974cbebba654 /src/libstd/thread | |
| parent | 8cf720bd19a00f52e3db630947f6424946ee0f6c (diff) | |
| download | rust-c1d9191fa576c600775b4fbb90a3d09ca5e0fa0b.tar.gz rust-c1d9191fa576c600775b4fbb90a3d09ca5e0fa0b.zip | |
Add a test for size_of Option<ThreadId>
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 40682da8f8b..d856f9b465e 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -1485,9 +1485,10 @@ fn _assert_sync_and_send() { mod tests { use super::Builder; use crate::any::Any; + use crate::mem; use crate::sync::mpsc::{channel, Sender}; use crate::result; - use crate::thread; + use crate::thread::{self, ThreadId}; use crate::time::Duration; use crate::u32; @@ -1718,6 +1719,11 @@ mod tests { } #[test] + fn test_size_of_option_thread_id() { + assert_eq!(mem::size_of::<Option<ThreadId>>(), mem::size_of::<ThreadId>()); + } + + #[test] fn test_thread_id_equal() { assert!(thread::current().id() == thread::current().id()); } |
