From 1c22902681f6614e09608da2f85981f03a78a849 Mon Sep 17 00:00:00 2001 From: Changgyoo Park Date: Mon, 30 Sep 2024 11:37:21 +0200 Subject: [PATCH] chore(*): prepare for SCC 2.2.0 --- CHANGELOG.md | 4 ++++ Cargo.toml | 2 +- src/hash_table/bucket.rs | 2 ++ src/tests/correctness.rs | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bae633..4b8e391 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Version 2 +2.2.0 + +* (IN-PROGRESS) Add `Comparable` and `Equivalent` traits: [#162](https://github.com/wvwwvwwv/scalable-concurrent-containers/issues/162) by [qthree](https://github.com/qthree). + 2.1.18 * Add `TreeIndex::peek_entry`: [#157](https://github.com/wvwwvwwv/scalable-concurrent-containers/issues/157) by [qthree](https://github.com/qthree). diff --git a/Cargo.toml b/Cargo.toml index 862e30f..fbc4ad8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "scc" description = "High performance containers and utilities for concurrent and asynchronous programming" documentation = "https://docs.rs/scc" -version = "2.1.18" +version = "2.2.0" authors = ["wvwwvwwv "] edition = "2021" rust-version = "1.65.0" diff --git a/src/hash_table/bucket.rs b/src/hash_table/bucket.rs index e8b6edb..ae460bd 100644 --- a/src/hash_table/bucket.rs +++ b/src/hash_table/bucket.rs @@ -1282,7 +1282,9 @@ mod test { use std::pin::Pin; use tokio::sync::Barrier; + #[cfg(not(miri))] static_assertions::assert_eq_size!(Bucket, [u8; BUCKET_LEN * 2]); + #[cfg(not(miri))] static_assertions::assert_eq_size!(Bucket, [u8; BUCKET_LEN * 4]); fn default_bucket() -> Bucket { diff --git a/src/tests/correctness.rs b/src/tests/correctness.rs index c9d50ad..fddfbea 100644 --- a/src/tests/correctness.rs +++ b/src/tests/correctness.rs @@ -14,13 +14,21 @@ mod hashmap_test { use std::sync::Arc; use tokio::sync::Barrier as AsyncBarrier; + #[cfg(not(miri))] static_assertions::assert_impl_all!(HashMap: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_impl_all!(Reserve: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(HashMap: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(Reserve: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_impl_all!(hash_map::OccupiedEntry: Send, Sync); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(hash_map::OccupiedEntry: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_impl_all!(hash_map::VacantEntry: Send, Sync); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(hash_map::VacantEntry: Send, Sync, UnwindSafe); struct R(&'static AtomicUsize); @@ -816,9 +824,13 @@ mod hashindex_test { use std::thread; use tokio::sync::Barrier as AsyncBarrier; + #[cfg(not(miri))] static_assertions::assert_impl_all!(HashIndex: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_impl_all!(Iter<'static, 'static, String, String>: UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(HashIndex: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(Iter<'static, 'static, String, *const String>: Send, Sync, UnwindSafe); struct R(&'static AtomicUsize); @@ -1426,7 +1438,9 @@ mod hashset_test { use crate::HashSet; use std::panic::UnwindSafe; + #[cfg(not(miri))] static_assertions::assert_impl_all!(HashSet: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(HashSet<*const String>: Send, Sync, UnwindSafe); #[test] @@ -1464,11 +1478,17 @@ mod hashcache_test { use std::sync::Arc; use tokio::sync::Barrier as AsyncBarrier; + #[cfg(not(miri))] static_assertions::assert_impl_all!(HashCache: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(HashCache: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_impl_all!(hash_cache::OccupiedEntry: Send, Sync); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(hash_cache::OccupiedEntry: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_impl_all!(hash_cache::VacantEntry: Send, Sync); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(hash_cache::VacantEntry: Send, Sync, UnwindSafe); struct R(&'static AtomicUsize); @@ -1815,11 +1835,17 @@ mod treeindex_test { use tokio::sync::Barrier as AsyncBarrier; use tokio::task; + #[cfg(not(miri))] static_assertions::assert_impl_all!(TreeIndex: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_impl_all!(Iter<'static, 'static, String, String>: UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_impl_all!(Range<'static, 'static, String, String, String, RangeInclusive>: UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(TreeIndex: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(Iter<'static, 'static, String, *const String>: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(Range<'static, 'static, String, *const String, String, RangeInclusive>: Send, Sync, UnwindSafe); struct R(&'static AtomicUsize); @@ -2600,9 +2626,13 @@ mod bag_test { use tokio::sync::Barrier as AsyncBarrier; use tokio::task; + #[cfg(not(miri))] static_assertions::assert_impl_all!(Bag: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_impl_all!(IterMut<'static, String>: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(Bag<*const String>: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(IterMut<'static, *const String>: Send, Sync, UnwindSafe); struct R(&'static AtomicUsize); @@ -2783,7 +2813,9 @@ mod queue_test { use std::sync::{Arc, Barrier}; use std::thread; + #[cfg(not(miri))] static_assertions::assert_impl_all!(Queue: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(Queue<*const String>: Send, Sync, UnwindSafe); struct R(&'static AtomicUsize, usize, usize); @@ -2976,7 +3008,9 @@ mod stack_test { use std::{panic::UnwindSafe, sync::Arc}; use tokio::sync::Barrier as AsyncBarrier; + #[cfg(not(miri))] static_assertions::assert_impl_all!(Stack: Send, Sync, UnwindSafe); + #[cfg(not(miri))] static_assertions::assert_not_impl_all!(Stack<*const String>: Send, Sync, UnwindSafe); #[derive(Debug)]