aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid LeGare <legare@google.com>2022-03-05 02:05:30 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-03-05 02:05:30 +0000
commit8a68abf818f945a6242f3c2cd1948e3759e124eb (patch)
tree695013359c187d2948f2e46f268e261698497aa3
parent0bf0fa88a8cd59d4b2f697d8438f3e090242747c (diff)
parentc42af5446abaca9bec3943bc86fa0b14dc84857a (diff)
downloadfutures-task-android13-qpr1-s6-release.tar.gz
Update futures-task to 0.3.21 am: c8d44d99a8 am: 703f74a90e am: c42af5446at_frc_odp_330442040t_frc_odp_330442000t_frc_ase_330444010android-13.0.0_r83android-13.0.0_r82android-13.0.0_r81android-13.0.0_r80android-13.0.0_r79android-13.0.0_r78android-13.0.0_r77android-13.0.0_r76android-13.0.0_r75android-13.0.0_r74android-13.0.0_r73android-13.0.0_r72android-13.0.0_r71android-13.0.0_r70android-13.0.0_r69android-13.0.0_r68android-13.0.0_r67android-13.0.0_r66android-13.0.0_r65android-13.0.0_r64android-13.0.0_r63android-13.0.0_r62android-13.0.0_r61android-13.0.0_r60android-13.0.0_r59android-13.0.0_r58android-13.0.0_r57android-13.0.0_r56android-13.0.0_r55android-13.0.0_r54android-13.0.0_r53android-13.0.0_r52android-13.0.0_r51android-13.0.0_r50android-13.0.0_r49android-13.0.0_r48android-13.0.0_r47android-13.0.0_r46android-13.0.0_r45android-13.0.0_r44android-13.0.0_r43android-13.0.0_r42android-13.0.0_r41android-13.0.0_r40android-13.0.0_r39android-13.0.0_r38android-13.0.0_r37android-13.0.0_r36android-13.0.0_r35android-13.0.0_r34android-13.0.0_r33android-13.0.0_r32android-13.0.0_r30android-13.0.0_r29android-13.0.0_r28android-13.0.0_r27android-13.0.0_r24android-13.0.0_r23android-13.0.0_r22android-13.0.0_r21android-13.0.0_r20android-13.0.0_r19android-13.0.0_r18android-13.0.0_r17android-13.0.0_r16aml_go_odp_330912000aml_go_ads_330915100aml_go_ads_330915000aml_go_ads_330913000android13-qpr3-s9-releaseandroid13-qpr3-s8-releaseandroid13-qpr3-s7-releaseandroid13-qpr3-s6-releaseandroid13-qpr3-s5-releaseandroid13-qpr3-s4-releaseandroid13-qpr3-s3-releaseandroid13-qpr3-s2-releaseandroid13-qpr3-s14-releaseandroid13-qpr3-s13-releaseandroid13-qpr3-s12-releaseandroid13-qpr3-s11-releaseandroid13-qpr3-s10-releaseandroid13-qpr3-s1-releaseandroid13-qpr3-releaseandroid13-qpr3-c-s8-releaseandroid13-qpr3-c-s7-releaseandroid13-qpr3-c-s6-releaseandroid13-qpr3-c-s5-releaseandroid13-qpr3-c-s4-releaseandroid13-qpr3-c-s3-releaseandroid13-qpr3-c-s2-releaseandroid13-qpr3-c-s12-releaseandroid13-qpr3-c-s11-releaseandroid13-qpr3-c-s10-releaseandroid13-qpr3-c-s1-releaseandroid13-qpr2-s9-releaseandroid13-qpr2-s8-releaseandroid13-qpr2-s7-releaseandroid13-qpr2-s6-releaseandroid13-qpr2-s5-releaseandroid13-qpr2-s3-releaseandroid13-qpr2-s2-releaseandroid13-qpr2-s12-releaseandroid13-qpr2-s11-releaseandroid13-qpr2-s10-releaseandroid13-qpr2-s1-releaseandroid13-qpr2-releaseandroid13-qpr2-b-s1-releaseandroid13-qpr1-s8-releaseandroid13-qpr1-s7-releaseandroid13-qpr1-s6-releaseandroid13-qpr1-s5-releaseandroid13-qpr1-s4-releaseandroid13-qpr1-s3-releaseandroid13-qpr1-s2-releaseandroid13-qpr1-s1-releaseandroid13-qpr1-releaseandroid13-mainline-go-adservices-releaseandroid13-frc-odp-releaseandroid13-devandroid13-d4-s2-releaseandroid13-d4-s1-releaseandroid13-d4-releaseandroid13-d3-s1-releaseandroid13-d2-release
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/futures-task/+/2004793 Change-Id: I71778f17ede6d18206eb1e534b515568d187a094
-rw-r--r--.cargo_vcs_info.json7
-rw-r--r--Android.bp4
-rw-r--r--Cargo.toml10
-rw-r--r--Cargo.toml.orig5
-rw-r--r--METADATA10
-rw-r--r--README.md23
-rw-r--r--build.rs21
-rw-r--r--no_atomic_cas.rs2
-rw-r--r--src/future_obj.rs23
-rw-r--r--src/waker.rs10
-rw-r--r--src/waker_ref.rs2
11 files changed, 69 insertions, 48 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index ffd4f55..1f750b1 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,6 @@
{
"git": {
- "sha1": "7caefa51304e78fd5018cd5d2a03f3b9089cc010"
- }
-}
+ "sha1": "fc1e3250219170e31cddb8857a276cba7dd08d44"
+ },
+ "path_in_vcs": "futures-task"
+} \ No newline at end of file
diff --git a/Android.bp b/Android.bp
index 3c6419a..eebc67c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -42,7 +42,7 @@ rust_test {
host_supported: true,
crate_name: "futures_task",
cargo_env_compat: true,
- cargo_pkg_version: "0.3.17",
+ cargo_pkg_version: "0.3.21",
srcs: ["src/lib.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
@@ -62,7 +62,7 @@ rust_library {
host_supported: true,
crate_name: "futures_task",
cargo_env_compat: true,
- cargo_pkg_version: "0.3.17",
+ cargo_pkg_version: "0.3.21",
srcs: ["src/lib.rs"],
edition: "2018",
features: [
diff --git a/Cargo.toml b/Cargo.toml
index 1a09a27..c65433f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,14 +11,16 @@
[package]
edition = "2018"
+rust-version = "1.45"
name = "futures-task"
-version = "0.3.17"
-authors = ["Alex Crichton <alex@alexcrichton.com>"]
-description = "Tools for working with tasks.\n"
+version = "0.3.21"
+description = """
+Tools for working with tasks.
+"""
homepage = "https://rust-lang.github.io/futures-rs"
-documentation = "https://docs.rs/futures-task/0.3"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/futures-rs"
+
[package.metadata.docs.rs]
all-features = true
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 23e5aed..77fec6f 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,12 +1,11 @@
[package]
name = "futures-task"
+version = "0.3.21"
edition = "2018"
-version = "0.3.17"
-authors = ["Alex Crichton <alex@alexcrichton.com>"]
+rust-version = "1.45"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/futures-rs"
homepage = "https://rust-lang.github.io/futures-rs"
-documentation = "https://docs.rs/futures-task/0.3"
description = """
Tools for working with tasks.
"""
diff --git a/METADATA b/METADATA
index eb20dd2..87e267d 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/futures-task/futures-task-0.3.17.crate"
+ value: "https://static.crates.io/crates/futures-task/futures-task-0.3.21.crate"
}
- version: "0.3.17"
+ version: "0.3.21"
license_type: NOTICE
last_upgrade_date {
- year: 2021
- month: 9
- day: 22
+ year: 2022
+ month: 3
+ day: 1
}
}
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..8ceeba9
--- /dev/null
+++ b/README.md
@@ -0,0 +1,23 @@
+# futures-task
+
+Tools for working with tasks.
+
+## Usage
+
+Add this to your `Cargo.toml`:
+
+```toml
+[dependencies]
+futures-task = "0.3"
+```
+
+The current `futures-task` requires Rust 1.45 or later.
+
+## License
+
+Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
+[MIT license](LICENSE-MIT) at your option.
+
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in the work by you, as defined in the Apache-2.0 license, shall
+be dual licensed as above, without any additional terms or conditions.
diff --git a/build.rs b/build.rs
index 07b50bd..05e0496 100644
--- a/build.rs
+++ b/build.rs
@@ -1,9 +1,3 @@
-#![warn(rust_2018_idioms, single_use_lifetimes)]
-
-use std::env;
-
-include!("no_atomic_cas.rs");
-
// The rustc-cfg listed below are considered public API, but it is *unstable*
// and outside of the normal semver guarantees:
//
@@ -13,10 +7,15 @@ include!("no_atomic_cas.rs");
// need to enable it manually when building for custom targets or using
// non-cargo build systems that don't run the build script.
//
-// With the exceptions mentioned above, the rustc-cfg strings below are
-// *not* public API. Please let us know by opening a GitHub issue if your build
-// environment requires some way to enable these cfgs other than by executing
-// our build script.
+// With the exceptions mentioned above, the rustc-cfg emitted by the build
+// script are *not* public API.
+
+#![warn(rust_2018_idioms, single_use_lifetimes)]
+
+use std::env;
+
+include!("no_atomic_cas.rs");
+
fn main() {
let target = match env::var("TARGET") {
Ok(target) => target,
@@ -34,7 +33,7 @@ fn main() {
// `cfg(target_has_atomic = "ptr")` as true when the build script doesn't
// run. This is needed for compatibility with non-cargo build systems that
// don't run the build script.
- if NO_ATOMIC_CAS_TARGETS.contains(&&*target) {
+ if NO_ATOMIC_CAS.contains(&&*target) {
println!("cargo:rustc-cfg=futures_no_atomic_cas");
}
diff --git a/no_atomic_cas.rs b/no_atomic_cas.rs
index 4708bf8..9b05d4b 100644
--- a/no_atomic_cas.rs
+++ b/no_atomic_cas.rs
@@ -1,7 +1,7 @@
// This file is @generated by no_atomic_cas.sh.
// It is not intended for manual editing.
-const NO_ATOMIC_CAS_TARGETS: &[&str] = &[
+const NO_ATOMIC_CAS: &[&str] = &[
"avr-unknown-gnu-atmega328",
"bpfeb-unknown-none",
"bpfel-unknown-none",
diff --git a/src/future_obj.rs b/src/future_obj.rs
index 48ec12b..f67494a 100644
--- a/src/future_obj.rs
+++ b/src/future_obj.rs
@@ -224,7 +224,7 @@ mod if_alloc {
}
unsafe fn drop(ptr: *mut (dyn Future<Output = T> + 'a)) {
- drop(Box::from_raw(ptr as *mut F))
+ drop(Box::from_raw(ptr.cast::<F>()))
}
}
@@ -252,10 +252,9 @@ mod if_alloc {
where
F: Future<Output = T> + 'a,
{
- fn into_raw(mut self) -> *mut (dyn Future<Output = T> + 'a) {
- let ptr = unsafe { self.as_mut().get_unchecked_mut() as *mut _ };
- mem::forget(self);
- ptr
+ fn into_raw(self) -> *mut (dyn Future<Output = T> + 'a) {
+ let mut this = mem::ManuallyDrop::new(self);
+ unsafe { this.as_mut().get_unchecked_mut() as *mut _ }
}
unsafe fn drop(ptr: *mut (dyn Future<Output = T> + 'a)) {
@@ -264,10 +263,9 @@ mod if_alloc {
}
unsafe impl<'a, T: 'a> UnsafeFutureObj<'a, T> for Pin<Box<dyn Future<Output = T> + 'a>> {
- fn into_raw(mut self) -> *mut (dyn Future<Output = T> + 'a) {
- let ptr = unsafe { self.as_mut().get_unchecked_mut() as *mut _ };
- mem::forget(self);
- ptr
+ fn into_raw(self) -> *mut (dyn Future<Output = T> + 'a) {
+ let mut this = mem::ManuallyDrop::new(self);
+ unsafe { this.as_mut().get_unchecked_mut() as *mut _ }
}
unsafe fn drop(ptr: *mut (dyn Future<Output = T> + 'a)) {
@@ -276,10 +274,9 @@ mod if_alloc {
}
unsafe impl<'a, T: 'a> UnsafeFutureObj<'a, T> for Pin<Box<dyn Future<Output = T> + Send + 'a>> {
- fn into_raw(mut self) -> *mut (dyn Future<Output = T> + 'a) {
- let ptr = unsafe { self.as_mut().get_unchecked_mut() as *mut _ };
- mem::forget(self);
- ptr
+ fn into_raw(self) -> *mut (dyn Future<Output = T> + 'a) {
+ let mut this = mem::ManuallyDrop::new(self);
+ unsafe { this.as_mut().get_unchecked_mut() as *mut _ }
}
unsafe fn drop(ptr: *mut (dyn Future<Output = T> + 'a)) {
diff --git a/src/waker.rs b/src/waker.rs
index a7310a0..7911256 100644
--- a/src/waker.rs
+++ b/src/waker.rs
@@ -20,7 +20,7 @@ pub fn waker<W>(wake: Arc<W>) -> Waker
where
W: ArcWake + 'static,
{
- let ptr = Arc::into_raw(wake) as *const ();
+ let ptr = Arc::into_raw(wake).cast::<()>();
unsafe { Waker::from_raw(RawWaker::new(ptr, waker_vtable::<W>())) }
}
@@ -31,7 +31,7 @@ where
#[allow(clippy::redundant_clone)] // The clone here isn't actually redundant.
unsafe fn increase_refcount<T: ArcWake>(data: *const ()) {
// Retain Arc, but don't touch refcount by wrapping in ManuallyDrop
- let arc = mem::ManuallyDrop::new(Arc::<T>::from_raw(data as *const T));
+ let arc = mem::ManuallyDrop::new(Arc::<T>::from_raw(data.cast::<T>()));
// Now increase refcount, but don't drop new refcount either
let _arc_clone: mem::ManuallyDrop<_> = arc.clone();
}
@@ -43,17 +43,17 @@ unsafe fn clone_arc_raw<T: ArcWake>(data: *const ()) -> RawWaker {
}
unsafe fn wake_arc_raw<T: ArcWake>(data: *const ()) {
- let arc: Arc<T> = Arc::from_raw(data as *const T);
+ let arc: Arc<T> = Arc::from_raw(data.cast::<T>());
ArcWake::wake(arc);
}
// used by `waker_ref`
unsafe fn wake_by_ref_arc_raw<T: ArcWake>(data: *const ()) {
// Retain Arc, but don't touch refcount by wrapping in ManuallyDrop
- let arc = mem::ManuallyDrop::new(Arc::<T>::from_raw(data as *const T));
+ let arc = mem::ManuallyDrop::new(Arc::<T>::from_raw(data.cast::<T>()));
ArcWake::wake_by_ref(&arc);
}
unsafe fn drop_arc_raw<T: ArcWake>(data: *const ()) {
- drop(Arc::<T>::from_raw(data as *const T))
+ drop(Arc::<T>::from_raw(data.cast::<T>()))
}
diff --git a/src/waker_ref.rs b/src/waker_ref.rs
index 791c690..7fb552f 100644
--- a/src/waker_ref.rs
+++ b/src/waker_ref.rs
@@ -55,7 +55,7 @@ where
{
// simply copy the pointer instead of using Arc::into_raw,
// as we don't actually keep a refcount by using ManuallyDrop.<
- let ptr = (&**wake as *const W) as *const ();
+ let ptr = Arc::as_ptr(wake).cast::<()>();
let waker =
ManuallyDrop::new(unsafe { Waker::from_raw(RawWaker::new(ptr, waker_vtable::<W>())) });