Upgrade rust/crates/futures-task to 0.3.12 am: 0ea7c8774e
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/futures-task/+/1582221
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I783230b04781abaaf587f194bc61f2096628d8cf
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
new file mode 100644
index 0000000..4fd4ba3
--- /dev/null
+++ b/.cargo_vcs_info.json
@@ -0,0 +1,5 @@
+{
+ "git": {
+ "sha1": "1d53a29ec16ccd5b094fb205edb73591455eb4b6"
+ }
+}
diff --git a/Android.bp b/Android.bp
index 26d6e64..71f0c3b 100644
--- a/Android.bp
+++ b/Android.bp
@@ -21,6 +21,9 @@
rust_test_host {
name: "futures-task_host_test_src_lib",
defaults: ["futures-task_defaults"],
+ test_options: {
+ unit_test: true,
+ },
}
rust_test {
diff --git a/Cargo.toml b/Cargo.toml
index 6f872c6..85fce8d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,11 +13,11 @@
[package]
edition = "2018"
name = "futures-task"
-version = "0.3.7"
+version = "0.3.12"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
description = "Tools for working with tasks.\n"
homepage = "https://rust-lang.github.io/futures-rs"
-documentation = "https://docs.rs/futures-task/0.3.7"
+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]
@@ -28,6 +28,8 @@
optional = true
default-features = false
+[dev-dependencies]
+
[features]
alloc = []
cfg-target-has-atomic = []
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index f07ec6f..3a8a67a 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,12 +1,12 @@
[package]
name = "futures-task"
edition = "2018"
-version = "0.3.7"
+version = "0.3.12"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
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.7"
+documentation = "https://docs.rs/futures-task/0.3"
description = """
Tools for working with tasks.
"""
@@ -25,5 +25,8 @@
[dependencies]
once_cell = { version = "1.3.1", default-features = false, features = ["std"], optional = true }
+[dev-dependencies]
+futures = { path = "../futures" }
+
[package.metadata.docs.rs]
all-features = true
diff --git a/METADATA b/METADATA
index c68b40e..eeb4499 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/futures-task/futures-task-0.3.7.crate"
+ value: "https://static.crates.io/crates/futures-task/futures-task-0.3.12.crate"
}
- version: "0.3.7"
+ version: "0.3.12"
license_type: NOTICE
last_upgrade_date {
- year: 2020
- month: 10
- day: 25
+ year: 2021
+ month: 2
+ day: 9
}
}
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 5dd9d80..95000de 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,18 +1,10 @@
-// Generated by cargo2android.py for tests in Android.bp
+// Generated by update_crate_tests.py for tests that depend on this crate.
{
"presubmit": [
{
- "host": true,
- "name": "futures-task_host_test_src_lib"
- },
- {
"name": "futures-task_device_test_src_lib"
},
{
- "host": true,
- "name": "futures-util_host_test_src_lib"
- },
- {
"name": "futures-util_device_test_src_lib"
}
]
diff --git a/src/future_obj.rs b/src/future_obj.rs
index 6acdf7c..373be24 100644
--- a/src/future_obj.rs
+++ b/src/future_obj.rs
@@ -42,8 +42,8 @@
impl<'a, T> LocalFutureObj<'a, T> {
/// Create a `LocalFutureObj` from a custom trait object representation.
#[inline]
- pub fn new<F: UnsafeFutureObj<'a, T> + 'a>(f: F) -> LocalFutureObj<'a, T> {
- LocalFutureObj {
+ pub fn new<F: UnsafeFutureObj<'a, T> + 'a>(f: F) -> Self {
+ Self {
future: unsafe { remove_future_lifetime(f.into_raw()) },
drop_fn: unsafe { remove_drop_lifetime(F::drop) },
_marker: PhantomData,
@@ -72,7 +72,7 @@
impl<'a, T> From<FutureObj<'a, T>> for LocalFutureObj<'a, T> {
#[inline]
- fn from(f: FutureObj<'a, T>) -> LocalFutureObj<'a, T> {
+ fn from(f: FutureObj<'a, T>) -> Self {
f.0
}
}
@@ -113,8 +113,8 @@
impl<'a, T> FutureObj<'a, T> {
/// Create a `FutureObj` from a custom trait object representation.
#[inline]
- pub fn new<F: UnsafeFutureObj<'a, T> + Send>(f: F) -> FutureObj<'a, T> {
- FutureObj(LocalFutureObj::new(f))
+ pub fn new<F: UnsafeFutureObj<'a, T> + Send>(f: F) -> Self {
+ Self(LocalFutureObj::new(f))
}
}
@@ -296,49 +296,49 @@
impl<'a, F: Future<Output = ()> + Send + 'a> From<Box<F>> for FutureObj<'a, ()> {
fn from(boxed: Box<F>) -> Self {
- FutureObj::new(boxed)
+ Self::new(boxed)
}
}
impl<'a> From<Box<dyn Future<Output = ()> + Send + 'a>> for FutureObj<'a, ()> {
fn from(boxed: Box<dyn Future<Output = ()> + Send + 'a>) -> Self {
- FutureObj::new(boxed)
+ Self::new(boxed)
}
}
impl<'a, F: Future<Output = ()> + Send + 'a> From<Pin<Box<F>>> for FutureObj<'a, ()> {
fn from(boxed: Pin<Box<F>>) -> Self {
- FutureObj::new(boxed)
+ Self::new(boxed)
}
}
impl<'a> From<Pin<Box<dyn Future<Output = ()> + Send + 'a>>> for FutureObj<'a, ()> {
fn from(boxed: Pin<Box<dyn Future<Output = ()> + Send + 'a>>) -> Self {
- FutureObj::new(boxed)
+ Self::new(boxed)
}
}
impl<'a, F: Future<Output = ()> + 'a> From<Box<F>> for LocalFutureObj<'a, ()> {
fn from(boxed: Box<F>) -> Self {
- LocalFutureObj::new(boxed)
+ Self::new(boxed)
}
}
impl<'a> From<Box<dyn Future<Output = ()> + 'a>> for LocalFutureObj<'a, ()> {
fn from(boxed: Box<dyn Future<Output = ()> + 'a>) -> Self {
- LocalFutureObj::new(boxed)
+ Self::new(boxed)
}
}
impl<'a, F: Future<Output = ()> + 'a> From<Pin<Box<F>>> for LocalFutureObj<'a, ()> {
fn from(boxed: Pin<Box<F>>) -> Self {
- LocalFutureObj::new(boxed)
+ Self::new(boxed)
}
}
impl<'a> From<Pin<Box<dyn Future<Output = ()> + 'a>>> for LocalFutureObj<'a, ()> {
fn from(boxed: Pin<Box<dyn Future<Output = ()> + 'a>>) -> Self {
- LocalFutureObj::new(boxed)
+ Self::new(boxed)
}
}
}
diff --git a/src/lib.rs b/src/lib.rs
index 0366689..92b4ad0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -8,16 +8,8 @@
// 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)]
-
-// mem::take requires Rust 1.40, matches! requires Rust 1.42
-// Can be removed if the minimum supported version increased or if https://github.com/rust-lang/rust-clippy/issues/3941
-// get's implemented.
-#![allow(clippy::mem_replace_with_default, clippy::match_like_matches_macro)]
-
#![doc(test(attr(deny(warnings), allow(dead_code, unused_assignments, unused_variables))))]
-#![doc(html_root_url = "https://docs.rs/futures-task/0.3.7")]
-
#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "unstable")))]
compile_error!("The `cfg-target-has-atomic` feature requires the `unstable` feature as an explicit opt-in to unstable features");
diff --git a/src/waker_ref.rs b/src/waker_ref.rs
index 8dda499..76d849a 100644
--- a/src/waker_ref.rs
+++ b/src/waker_ref.rs
@@ -22,7 +22,7 @@
// copy the underlying (raw) waker without calling a clone,
// as we won't call Waker::drop either.
let waker = ManuallyDrop::new(unsafe { core::ptr::read(waker) });
- WakerRef {
+ Self {
waker,
_marker: PhantomData,
}
@@ -35,7 +35,7 @@
/// by the caller), and the [`Waker`] doesn't need to or must not be
/// destroyed.
pub fn new_unowned(waker: ManuallyDrop<Waker>) -> Self {
- WakerRef {
+ Self {
waker,
_marker: PhantomData,
}