diff --git a/src/map.rs b/src/map.rs index 5bb4a9d358..18c2b46d3b 100644 --- a/src/map.rs +++ b/src/map.rs @@ -190,6 +190,7 @@ pub enum DefaultHashBuilder {} /// // use the values stored in map /// } /// ``` +#[repr(C)] #[derive(Clone)] pub struct HashMap { pub(crate) hash_builder: S, diff --git a/src/raw/mod.rs b/src/raw/mod.rs index 1a04b9ac1f..c105c5a1ce 100644 --- a/src/raw/mod.rs +++ b/src/raw/mod.rs @@ -329,6 +329,7 @@ impl Bucket { } /// A raw hash table with an unsafe API. +#[repr(C)] pub struct RawTable { // Mask to get an index from a hash value. The value is one less than the // number of buckets in the table.