diff options
author | Joel Galenson <jgalenson@google.com> | 2021-08-10 17:13:07 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-08-10 17:13:07 +0000 |
commit | 2fb62bad5dd23b901659452a8d78af4ba526d7ef (patch) | |
tree | 09b3b665cc59b902554d2c0face9ff4a437fae4f | |
parent | da937e461b27a548abd405498dafea929d594f72 (diff) | |
parent | 4cfe7c45240129e4517431bc81d0c5aa5459d6cc (diff) | |
download | futures-task-2fb62bad5dd23b901659452a8d78af4ba526d7ef.tar.gz |
Upgrade rust/crates/futures-task to 0.3.16 am: 5d230bc7e1 am: 4cfe7c4524
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/futures-task/+/1790950
Change-Id: Ibeb4d14e80e779027ebac47b85448875fdcc705d
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 6 | ||||
-rw-r--r-- | Cargo.toml | 11 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 8 | ||||
-rw-r--r-- | build.rs | 2 | ||||
-rw-r--r-- | no_atomic_cas.rs | 2 | ||||
-rw-r--r-- | src/lib.rs | 54 | ||||
-rw-r--r-- | src/spawn.rs | 32 |
9 files changed, 60 insertions, 59 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index ec6442e..99dc8b0 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "fc080d153bc7bf00429ec5e2b91e2f21f2243846" + "sha1": "ab38fd29d3f84f8fc028fa7883e53dba423da0ee" } } @@ -38,7 +38,7 @@ license { } rust_defaults { - name: "futures-task_defaults", + name: "futures-task_test_defaults", crate_name: "futures_task", srcs: ["src/lib.rs"], test_suites: ["general-tests"], @@ -53,7 +53,7 @@ rust_defaults { rust_test_host { name: "futures-task_host_test_src_lib", - defaults: ["futures-task_defaults"], + defaults: ["futures-task_test_defaults"], test_options: { unit_test: true, }, @@ -61,7 +61,7 @@ rust_test_host { rust_test { name: "futures-task_device_test_src_lib", - defaults: ["futures-task_defaults"], + defaults: ["futures-task_test_defaults"], } rust_library { @@ -3,17 +3,16 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies +# to registry (e.g., crates.io) dependencies. # -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "futures-task" -version = "0.3.15" +version = "0.3.16" authors = ["Alex Crichton <alex@alexcrichton.com>"] description = "Tools for working with tasks.\n" homepage = "https://rust-lang.github.io/futures-rs" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index b454722..3d246ad 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,7 +1,7 @@ [package] name = "futures-task" edition = "2018" -version = "0.3.15" +version = "0.3.16" authors = ["Alex Crichton <alex@alexcrichton.com>"] license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/futures-rs" @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/futures-task/futures-task-0.3.15.crate" + value: "https://static.crates.io/crates/futures-task/futures-task-0.3.16.crate" } - version: "0.3.15" + version: "0.3.16" license_type: NOTICE last_upgrade_date { year: 2021 - month: 5 - day: 19 + month: 8 + day: 9 } } @@ -8,7 +8,7 @@ include!("no_atomic_cas.rs"); // and outside of the normal semver guarantees: // // - `futures_no_atomic_cas` -// Assume the target does not have atomic CAS (compare-and-swap). +// Assume the target does *not* support atomic CAS operations. // This is usually detected automatically by the build script, but you may // need to enable it manually when building for custom targets or using // non-cargo build systems that don't run the build script. diff --git a/no_atomic_cas.rs b/no_atomic_cas.rs index 0819af1..4708bf8 100644 --- a/no_atomic_cas.rs +++ b/no_atomic_cas.rs @@ -3,6 +3,8 @@ const NO_ATOMIC_CAS_TARGETS: &[&str] = &[ "avr-unknown-gnu-atmega328", + "bpfeb-unknown-none", + "bpfel-unknown-none", "msp430-none-elf", "riscv32i-unknown-none-elf", "riscv32imc-unknown-none-elf", @@ -1,41 +1,43 @@ //! Tools for working with tasks. #![cfg_attr(not(feature = "std"), no_std)] -#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms, unreachable_pub)] +#![warn(missing_debug_implementations, missing_docs, rust_2018_idioms, unreachable_pub)] // It cannot be included in the published code because this lints have false positives in the minimum required version. #![cfg_attr(test, warn(single_use_lifetimes))] -#![warn(clippy::all)] -#![doc(test(attr(deny(warnings), allow(dead_code, unused_assignments, unused_variables))))] +#![doc(test( + no_crate_inject, + attr( + deny(warnings, rust_2018_idioms, single_use_lifetimes), + allow(dead_code, unused_assignments, unused_variables) + ) +))] #[cfg(feature = "alloc")] extern crate alloc; -macro_rules! cfg_target_has_atomic { - ($($item:item)*) => {$( - #[cfg(not(futures_no_atomic_cas))] - $item - )*}; -} - mod spawn; pub use crate::spawn::{LocalSpawn, Spawn, SpawnError}; -cfg_target_has_atomic! { - #[cfg(feature = "alloc")] - mod arc_wake; - #[cfg(feature = "alloc")] - pub use crate::arc_wake::ArcWake; - - #[cfg(feature = "alloc")] - mod waker; - #[cfg(feature = "alloc")] - pub use crate::waker::waker; - - #[cfg(feature = "alloc")] - mod waker_ref; - #[cfg(feature = "alloc")] - pub use crate::waker_ref::{waker_ref, WakerRef}; -} +#[cfg(not(futures_no_atomic_cas))] +#[cfg(feature = "alloc")] +mod arc_wake; +#[cfg(not(futures_no_atomic_cas))] +#[cfg(feature = "alloc")] +pub use crate::arc_wake::ArcWake; + +#[cfg(not(futures_no_atomic_cas))] +#[cfg(feature = "alloc")] +mod waker; +#[cfg(not(futures_no_atomic_cas))] +#[cfg(feature = "alloc")] +pub use crate::waker::waker; + +#[cfg(not(futures_no_atomic_cas))] +#[cfg(feature = "alloc")] +mod waker_ref; +#[cfg(not(futures_no_atomic_cas))] +#[cfg(feature = "alloc")] +pub use crate::waker_ref::{waker_ref, WakerRef}; mod future_obj; pub use crate::future_obj::{FutureObj, LocalFutureObj, UnsafeFutureObj}; diff --git a/src/spawn.rs b/src/spawn.rs index 50f5d0d..f4e6339 100644 --- a/src/spawn.rs +++ b/src/spawn.rs @@ -168,27 +168,25 @@ mod if_alloc { } } - cfg_target_has_atomic! { - use alloc::{ sync::Arc }; - - impl<Sp: ?Sized + Spawn> Spawn for Arc<Sp> { - fn spawn_obj(&self, future: FutureObj<'static, ()>) -> Result<(), SpawnError> { - (**self).spawn_obj(future) - } + #[cfg(not(futures_no_atomic_cas))] + impl<Sp: ?Sized + Spawn> Spawn for alloc::sync::Arc<Sp> { + fn spawn_obj(&self, future: FutureObj<'static, ()>) -> Result<(), SpawnError> { + (**self).spawn_obj(future) + } - fn status(&self) -> Result<(), SpawnError> { - (**self).status() - } + fn status(&self) -> Result<(), SpawnError> { + (**self).status() } + } - impl<Sp: ?Sized + LocalSpawn> LocalSpawn for Arc<Sp> { - fn spawn_local_obj(&self, future: LocalFutureObj<'static, ()>) -> Result<(), SpawnError> { - (**self).spawn_local_obj(future) - } + #[cfg(not(futures_no_atomic_cas))] + impl<Sp: ?Sized + LocalSpawn> LocalSpawn for alloc::sync::Arc<Sp> { + fn spawn_local_obj(&self, future: LocalFutureObj<'static, ()>) -> Result<(), SpawnError> { + (**self).spawn_local_obj(future) + } - fn status_local(&self) -> Result<(), SpawnError> { - (**self).status_local() - } + fn status_local(&self) -> Result<(), SpawnError> { + (**self).status_local() } } } |