diff options
| author | The 8472 <git@infinite-source.de> | 2023-01-12 22:54:27 +0100 |
|---|---|---|
| committer | The 8472 <git@infinite-source.de> | 2023-12-11 23:38:48 +0100 |
| commit | 502df1b7d4f3ba61d55cf2b3a47785a7a4df940b (patch) | |
| tree | e27718c0a05dad64af78fe1f4277aa2a72190480 /library/alloc/src/raw_vec/tests.rs | |
| parent | 7e452c123c5acea813130a9519b34f83795cb856 (diff) | |
| download | rust-502df1b7d4f3ba61d55cf2b3a47785a7a4df940b.tar.gz rust-502df1b7d4f3ba61d55cf2b3a47785a7a4df940b.zip | |
add more niches to rawvec
Diffstat (limited to 'library/alloc/src/raw_vec/tests.rs')
| -rw-r--r-- | library/alloc/src/raw_vec/tests.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/library/alloc/src/raw_vec/tests.rs b/library/alloc/src/raw_vec/tests.rs index ff322f0da97..f8cada01c03 100644 --- a/library/alloc/src/raw_vec/tests.rs +++ b/library/alloc/src/raw_vec/tests.rs @@ -1,4 +1,5 @@ use super::*; +use core::mem::size_of; use std::cell::Cell; #[test] @@ -161,3 +162,11 @@ fn zst_reserve_exact_panic() { v.reserve_exact(101, usize::MAX - 100); } + +#[test] +fn niches() { + let baseline = size_of::<RawVec<u8>>(); + assert_eq!(size_of::<Option<RawVec<u8>>>(), baseline); + assert_eq!(size_of::<Option<Option<RawVec<u8>>>>(), baseline); + assert_eq!(size_of::<Option<Option<Option<RawVec<u8>>>>>(), baseline); +} |
