From dd0849b1a0cf2aa0288864ad7c32e477c3ad7765 Mon Sep 17 00:00:00 2001 From: Jeff Vander Stoep Date: Mon, 6 Mar 2023 11:24:08 +0100 Subject: Upgrade crossbeam-utils to 0.8.15 This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update rust/crates/crossbeam-utils For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md Test: TreeHugger Change-Id: I669d6530f267945b4362284fc6ff3302c55922c3 --- .cargo_vcs_info.json | 2 +- Android.bp | 6 +++--- CHANGELOG.md | 6 ++++++ Cargo.toml | 2 +- Cargo.toml.orig | 2 +- METADATA | 10 +++++----- no_atomic.rs | 3 +++ src/sync/parker.rs | 5 ++++- src/sync/sharded_lock.rs | 2 ++ src/thread.rs | 2 ++ 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 diff --git a/Android.bp b/Android.bp index 43b9d5a..5b4b500 100644 --- a/Android.bp +++ b/Android.bp @@ -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) diff --git a/Cargo.toml b/Cargo.toml index 6fe3f9f..a99b591 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/METADATA b/METADATA index a114c69..8121ef5 100644 --- a/METADATA +++ b/METADATA @@ -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 From for ShardedLock { } /// 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, _guard: RwLockReadGuard<'a, ()>, @@ -511,6 +512,7 @@ impl 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, _marker: PhantomData>, 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 = Arc>>; /// 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` is not lock-free. assert_eq!( AtomicCell::::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::() == 8 ); assert_eq!(mem::size_of::(), 8); assert_eq!(mem::align_of::(), 8); -- cgit v1.2.3