aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2020-10-26 23:18:58 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-10-26 23:18:58 +0000
commit68f0e374a14f5dfdde79e46f6e4dacfecf7854ce (patch)
tree21894822eb1c0da2673caaa31d1a339494e2484e
parentfd3827cc4e5f047ae8e0a1a1ade9cfa869f6a808 (diff)
parent8ec9c32e2ecd348a8558c1fb36d7b9679eb99ec9 (diff)
downloadasync-trait-68f0e374a14f5dfdde79e46f6e4dacfecf7854ce.tar.gz
Upgrade rust/crates/async-trait to 0.1.41 am: f8b73ea1d8 am: 8ec9c32e2e
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/async-trait/+/1474962 Change-Id: I69f75c818b3f214742372181903464bec8cc01c7
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp4
-rw-r--r--Cargo.toml2
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA8
-rw-r--r--src/expand.rs2
-rw-r--r--tests/test.rs23
-rw-r--r--tests/ui/send-not-implemented.stderr6
8 files changed, 37 insertions, 12 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 65f73e6..cd32e59 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "6695236fd9addd26caa11e2867ccf2adc9ffce81"
+ "sha1": "46e46dcc8ed0279028b83f1ff623ee6cfe9ef65e"
}
}
diff --git a/Android.bp b/Android.bp
index 6e5e11d..4e87f35 100644
--- a/Android.bp
+++ b/Android.bp
@@ -13,7 +13,7 @@ rust_proc_macro {
}
// dependent_library ["feature_list"]
-// proc-macro2-1.0.19 "default,proc-macro"
+// proc-macro2-1.0.24 "default,proc-macro"
// quote-1.0.7 "default,proc-macro"
-// syn-1.0.38 "clone-impls,default,derive,extra-traits,full,parsing,printing,proc-macro,quote,visit,visit-mut"
+// syn-1.0.48 "clone-impls,default,derive,extra-traits,full,parsing,printing,proc-macro,quote,visit,visit-mut"
// unicode-xid-0.2.1 "default"
diff --git a/Cargo.toml b/Cargo.toml
index 968245f..54bab1a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
[package]
edition = "2018"
name = "async-trait"
-version = "0.1.40"
+version = "0.1.41"
authors = ["David Tolnay <dtolnay@gmail.com>"]
description = "Type erasure for async trait methods"
documentation = "https://docs.rs/async-trait"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 788bcdf..9a9ed1d 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
[package]
name = "async-trait"
-version = "0.1.40"
+version = "0.1.41"
authors = ["David Tolnay <dtolnay@gmail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
diff --git a/METADATA b/METADATA
index a0eb879..5a455fd 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/async-trait/async-trait-0.1.40.crate"
+ value: "https://static.crates.io/crates/async-trait/async-trait-0.1.41.crate"
}
- version: "0.1.40"
+ version: "0.1.41"
license_type: NOTICE
last_upgrade_date {
year: 2020
- month: 9
- day: 1
+ month: 10
+ day: 26
}
}
diff --git a/src/expand.rs b/src/expand.rs
index f868c7d..aac8e46 100644
--- a/src/expand.rs
+++ b/src/expand.rs
@@ -72,6 +72,7 @@ pub fn expand(input: &mut Item, is_local: bool) {
if let Some(block) = block {
has_self |= has_self_in_block(block);
transform_block(context, sig, block, has_self, is_local);
+ method.attrs.push(parse_quote!(#[allow(clippy::used_underscore_binding)]));
}
let has_default = method.default.is_some();
transform_sig(context, sig, has_self, has_default, is_local);
@@ -101,6 +102,7 @@ pub fn expand(input: &mut Item, is_local: bool) {
let has_self = has_self_in_sig(sig) || has_self_in_block(block);
transform_block(context, sig, block, has_self, is_local);
transform_sig(context, sig, has_self, false, is_local);
+ method.attrs.push(parse_quote!(#[allow(clippy::used_underscore_binding)]));
}
}
}
diff --git a/tests/test.rs b/tests/test.rs
index 2d8b75b..002fd20 100644
--- a/tests/test.rs
+++ b/tests/test.rs
@@ -1025,3 +1025,26 @@ pub mod issue123 {
#[async_trait]
impl<T> Trait<T> for () {}
}
+
+// https://github.com/dtolnay/async-trait/issues/129
+pub mod issue129 {
+ #![deny(clippy::pedantic)]
+
+ use async_trait::async_trait;
+
+ #[async_trait]
+ pub trait TestTrait {
+ async fn a(_b: u8, c: u8) -> u8 {
+ c
+ }
+ }
+
+ pub struct TestStruct;
+
+ #[async_trait]
+ impl TestTrait for TestStruct {
+ async fn a(_b: u8, c: u8) -> u8 {
+ c
+ }
+ }
+}
diff --git a/tests/ui/send-not-implemented.stderr b/tests/ui/send-not-implemented.stderr
index 2f288f5..05c445b 100644
--- a/tests/ui/send-not-implemented.stderr
+++ b/tests/ui/send-not-implemented.stderr
@@ -9,14 +9,14 @@ error: future cannot be sent between threads safely
12 | | }
| |_____^ future returned by `__test` is not `Send`
|
- = help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::sync::MutexGuard<'_, ()>`
+ = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>`
note: future is not `Send` as this value is used across an await
--> $DIR/send-not-implemented.rs:11:9
|
10 | let _guard = mutex.lock().unwrap();
- | ------ has type `std::sync::MutexGuard<'_, ()>` which is not `Send`
+ | ------ has type `MutexGuard<'_, ()>` which is not `Send`
11 | f().await;
| ^^^^^^^^^ await occurs here, with `_guard` maybe used later
12 | }
| - `_guard` is later dropped here
- = note: required for the cast to the object type `dyn std::future::Future<Output = ()> + std::marker::Send`
+ = note: required for the cast to the object type `dyn Future<Output = ()> + Send`