diff options
author | Jeff Vander Stoep <jeffv@google.com> | 2023-03-07 03:06:18 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-03-07 03:06:18 +0000 |
commit | 7ce266baef9d48c1d9f186c1283990f5e8a6a43a (patch) | |
tree | f911dd6eba5c17815cb2681e4628e268a4613aed | |
parent | 35f0463565e21d3d9b39e680a7201def90cb6363 (diff) | |
parent | 5064a245adfef64b8b22ed98ccdb76e0705e6abd (diff) | |
download | crossbeam-utils-7ce266baef9d48c1d9f186c1283990f5e8a6a43a.tar.gz |
Upgrade crossbeam-utils to 0.8.15 am: dd0849b1a0 am: 5064a245ad
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/crossbeam-utils/+/2469469
Change-Id: Ia16cddcf10a309369f6a24536f2d3513f101d74a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 6 | ||||
-rw-r--r-- | CHANGELOG.md | 6 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 10 | ||||
-rw-r--r-- | no_atomic.rs | 3 | ||||
-rw-r--r-- | src/sync/parker.rs | 5 | ||||
-rw-r--r-- | src/sync/sharded_lock.rs | 2 | ||||
-rw-r--r-- | src/thread.rs | 2 | ||||
-rw-r--r-- | tests/atomic_cell.rs | 6 |
11 files changed, 29 insertions, 17 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index cef469e..415facc 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "366276a4dde8bd6b4bdab531c09e6ab1ff38c407" + "sha1": "721382b00b5dadd81954ed66764d547e2f1bb7a3" }, "path_in_vcs": "crossbeam-utils" }
\ No newline at end of file @@ -44,7 +44,7 @@ rust_test { host_supported: true, crate_name: "crossbeam_utils", cargo_env_compat: true, - cargo_pkg_version: "0.8.14", + cargo_pkg_version: "0.8.15", srcs: ["src/lib.rs"], test_suites: ["general-tests"], auto_gen_config: true, @@ -67,7 +67,7 @@ rust_defaults { name: "crossbeam-utils_test_defaults", crate_name: "crossbeam_utils", cargo_env_compat: true, - cargo_pkg_version: "0.8.14", + cargo_pkg_version: "0.8.15", test_suites: ["general-tests"], auto_gen_config: true, edition: "2018", @@ -148,7 +148,7 @@ rust_library { host_supported: true, crate_name: "crossbeam_utils", cargo_env_compat: true, - cargo_pkg_version: "0.8.14", + cargo_pkg_version: "0.8.15", srcs: ["src/lib.rs"], edition: "2018", features: [ diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e0fe35..994b6c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Version 0.8.15 + +- Add `#[clippy::has_significant_drop]` to `ShardedLock{Read,Write}Guard`. (#958) +- Improve handling of very large timeout. (#953) +- Soft-deprecate `thread::scope()` in favor of the more efficient `std::thread::scope` that stabilized on Rust 1.63. (#954) + # Version 0.8.14 - Fix build script bug introduced in 0.8.13. (#932) @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.38" name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.15" description = "Utilities for concurrent programming" homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils" readme = "README.md" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 1674775..155fcc1 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -4,7 +4,7 @@ name = "crossbeam-utils" # - Update CHANGELOG.md # - Update README.md # - Create "crossbeam-utils-X.Y.Z" git tag -version = "0.8.14" +version = "0.8.15" edition = "2018" rust-version = "1.38" license = "MIT OR Apache-2.0" @@ -11,13 +11,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/crossbeam-utils/crossbeam-utils-0.8.14.crate" + value: "https://static.crates.io/crates/crossbeam-utils/crossbeam-utils-0.8.15.crate" } - version: "0.8.14" + version: "0.8.15" license_type: NOTICE last_upgrade_date { - year: 2022 - month: 12 - day: 8 + year: 2023 + month: 3 + day: 6 } } diff --git a/no_atomic.rs b/no_atomic.rs index 8ce0d31..beb11b0 100644 --- a/no_atomic.rs +++ b/no_atomic.rs @@ -28,6 +28,7 @@ const NO_ATOMIC_64: &[&str] = &[ "armv5te-unknown-linux-musleabi", "armv5te-unknown-linux-uclibceabi", "armv6k-nintendo-3ds", + "armv7-sony-vita-newlibeabihf", "armv7r-none-eabi", "armv7r-none-eabihf", "avr-unknown-gnu-atmega328", @@ -74,6 +75,8 @@ const NO_ATOMIC_64: &[&str] = &[ #[allow(dead_code)] // Only crossbeam-utils uses this. const NO_ATOMIC: &[&str] = &[ "avr-unknown-gnu-atmega328", + "bpfeb-unknown-none", + "bpfel-unknown-none", "mipsel-sony-psx", "msp430-none-elf", "riscv32i-unknown-none-elf", diff --git a/src/sync/parker.rs b/src/sync/parker.rs index e791c44..9cb3a26 100644 --- a/src/sync/parker.rs +++ b/src/sync/parker.rs @@ -122,7 +122,10 @@ impl Parker { /// p.park_timeout(Duration::from_millis(500)); /// ``` pub fn park_timeout(&self, timeout: Duration) { - self.park_deadline(Instant::now() + timeout) + match Instant::now().checked_add(timeout) { + Some(deadline) => self.park_deadline(deadline), + None => self.park(), + } } /// Blocks the current thread until the token is made available, or until a certain deadline. diff --git a/src/sync/sharded_lock.rs b/src/sync/sharded_lock.rs index b43c55e..a8f4584 100644 --- a/src/sync/sharded_lock.rs +++ b/src/sync/sharded_lock.rs @@ -480,6 +480,7 @@ impl<T> From<T> for ShardedLock<T> { } /// A guard used to release the shared read access of a [`ShardedLock`] when dropped. +#[clippy::has_significant_drop] pub struct ShardedLockReadGuard<'a, T: ?Sized> { lock: &'a ShardedLock<T>, _guard: RwLockReadGuard<'a, ()>, @@ -511,6 +512,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for ShardedLockReadGuard<'_, T> { } /// A guard used to release the exclusive write access of a [`ShardedLock`] when dropped. +#[clippy::has_significant_drop] pub struct ShardedLockWriteGuard<'a, T: ?Sized> { lock: &'a ShardedLock<T>, _marker: PhantomData<RwLockWriteGuard<'a, T>>, diff --git a/src/thread.rs b/src/thread.rs index f1086d9..7446454 100644 --- a/src/thread.rs +++ b/src/thread.rs @@ -133,6 +133,8 @@ type SharedOption<T> = Arc<Mutex<Option<T>>>; /// returned containing errors from panicked threads. Note that if panics are implemented by /// aborting the process, no error is returned; see the notes of [std::panic::catch_unwind]. /// +/// **Note:** Since Rust 1.63, this function is soft-deprecated in favor of the more efficient [`std::thread::scope`]. +/// /// # Examples /// /// ``` diff --git a/tests/atomic_cell.rs b/tests/atomic_cell.rs index a1d1022..edb7a4b 100644 --- a/tests/atomic_cell.rs +++ b/tests/atomic_cell.rs @@ -35,11 +35,7 @@ fn is_lock_free() { // of `AtomicU64` is `8`, so `AtomicCell<u64>` is not lock-free. assert_eq!( AtomicCell::<u64>::is_lock_free(), - cfg!(not(crossbeam_no_atomic_64)) - && cfg!(any( - target_pointer_width = "64", - target_pointer_width = "128" - )) + cfg!(not(crossbeam_no_atomic_64)) && std::mem::align_of::<u64>() == 8 ); assert_eq!(mem::size_of::<U64Align8>(), 8); assert_eq!(mem::align_of::<U64Align8>(), 8); |