aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Galenson <jgalenson@google.com>2021-08-10 16:27:17 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-08-10 16:27:17 +0000
commit0b9ad6d61e5e7584fda750c19765360580424dbf (patch)
tree137c2d171fc8ee91bd552021e8589e87dd29a709
parentaf5acc173f260c1ebf4a2a25b0da83b86ffeef7f (diff)
parent7bb5d193edea478d1e84f4b4e14d8f81cb272113 (diff)
downloadasync-trait-0b9ad6d61e5e7584fda750c19765360580424dbf.tar.gz
Upgrade rust/crates/async-trait to 0.1.51 am: aa9cbeb7d8 am: 5f7f810f74 am: 7bb5d193ed
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/async-trait/+/1790987 Change-Id: I3bd2f188e43c6a0b1d1d2ecf48796eea21b750fe
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--.github/workflows/ci.yml2
-rw-r--r--Android.bp6
-rw-r--r--Cargo.toml11
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA8
-rw-r--r--README.md2
-rw-r--r--src/expand.rs8
-rw-r--r--src/lib.rs2
-rw-r--r--src/receiver.rs2
-rw-r--r--tests/test.rs21
-rw-r--r--tests/ui/bare-trait-object.stderr2
-rw-r--r--tests/ui/lifetime-span.stderr2
13 files changed, 47 insertions, 23 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index d7f5c7b..13458f0 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "651ddc1131325b08c1b76ae6b65c1f23ca4cf7cf"
+ "sha1": "a976397bfb05bc0e46daf37165952adb47f0c1f1"
}
}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4c3d289..9ee381c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- rust: [beta, stable, 1.40.0]
+ rust: [beta, stable, 1.42.0]
include:
- rust: nightly
rustflags: --cfg async_trait_nightly_testing
diff --git a/Android.bp b/Android.bp
index 22a10c5..702b974 100644
--- a/Android.bp
+++ b/Android.bp
@@ -50,7 +50,7 @@ rust_proc_macro {
}
// dependent_library ["feature_list"]
-// proc-macro2-1.0.26 "default,proc-macro"
+// proc-macro2-1.0.28 "default,proc-macro"
// quote-1.0.9 "default,proc-macro"
-// syn-1.0.69 "clone-impls,default,derive,extra-traits,full,parsing,printing,proc-macro,quote,visit,visit-mut"
-// unicode-xid-0.2.1 "default"
+// syn-1.0.74 "clone-impls,default,derive,extra-traits,full,parsing,printing,proc-macro,quote,visit,visit-mut"
+// unicode-xid-0.2.2 "default"
diff --git a/Cargo.toml b/Cargo.toml
index e97aafa..2673f52 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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 = "async-trait"
-version = "0.1.50"
+version = "0.1.51"
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 8af0b3b..45c933c 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
[package]
name = "async-trait"
-version = "0.1.50"
+version = "0.1.51"
authors = ["David Tolnay <dtolnay@gmail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
diff --git a/METADATA b/METADATA
index 4f74759..bd3c14f 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.50.crate"
+ value: "https://static.crates.io/crates/async-trait/async-trait-0.1.51.crate"
}
- version: "0.1.50"
+ version: "0.1.51"
license_type: NOTICE
last_upgrade_date {
year: 2021
- month: 4
- day: 21
+ month: 8
+ day: 9
}
}
diff --git a/README.md b/README.md
index c393c10..4753f50 100644
--- a/README.md
+++ b/README.md
@@ -217,7 +217,7 @@ error: the trait `Test` cannot be made into an object
For traits that need to be object safe and need to have default implementations
for some async methods, there are two resolutions. Either you can add Send
and/or Sync as supertraits (Send if there are `&mut self` methods with default
-implementations, Sync if there are `&self` methods with default implementions)
+implementations, Sync if there are `&self` methods with default implementations)
to constrain all implementors of the trait such that the default implementations
are applicable to them:
diff --git a/src/expand.rs b/src/expand.rs
index e78c6c4..3ae9eea 100644
--- a/src/expand.rs
+++ b/src/expand.rs
@@ -396,7 +396,13 @@ fn positional_arg(i: usize, pat: &Pat) -> Ident {
fn has_bound(supertraits: &Supertraits, marker: &Ident) -> bool {
for bound in supertraits {
if let TypeParamBound::Trait(bound) = bound {
- if bound.path.is_ident(marker) {
+ if bound.path.is_ident(marker)
+ || bound.path.segments.len() == 3
+ && (bound.path.segments[0].ident == "std"
+ || bound.path.segments[0].ident == "core")
+ && bound.path.segments[1].ident == "marker"
+ && bound.path.segments[2].ident == *marker
+ {
return true;
}
}
diff --git a/src/lib.rs b/src/lib.rs
index 100bee6..3ae002a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -259,7 +259,7 @@
//! implementations for some async methods, there are two resolutions. Either
//! you can add Send and/or Sync as supertraits (Send if there are `&mut self`
//! methods with default implementations, Sync if there are `&self` methods with
-//! default implementions) to constrain all implementors of the trait such that
+//! default implementations) to constrain all implementors of the trait such that
//! the default implementations are applicable to them:
//!
//! ```
diff --git a/src/receiver.rs b/src/receiver.rs
index f6ea327..2230db6 100644
--- a/src/receiver.rs
+++ b/src/receiver.rs
@@ -161,7 +161,7 @@ impl VisitMut for ReplaceSelf {
if i.mac.path.is_ident("macro_rules")
|| i.mac.path.segments.last().unwrap().ident == "select"
{
- self.visit_macro_mut(&mut i.mac)
+ self.visit_macro_mut(&mut i.mac);
}
}
}
diff --git a/tests/test.rs b/tests/test.rs
index 6f95576..348f3f9 100644
--- a/tests/test.rs
+++ b/tests/test.rs
@@ -1,12 +1,14 @@
#![cfg_attr(
async_trait_nightly_testing,
- feature(min_specialization, min_type_alias_impl_trait)
+ feature(min_specialization, type_alias_impl_trait)
)]
#![allow(
clippy::let_underscore_drop,
clippy::let_unit_value,
clippy::missing_panics_doc,
- clippy::trivially_copy_pass_by_ref
+ clippy::needless_return,
+ clippy::trivially_copy_pass_by_ref,
+ clippy::unused_async
)]
use async_trait::async_trait;
@@ -1331,7 +1333,7 @@ pub mod issue158 {
#[async_trait]
pub trait Trait {
async fn f(&self) {
- self::f()
+ self::f();
}
}
}
@@ -1361,3 +1363,16 @@ pub mod issue161 {
}
}
}
+
+// https://github.com/dtolnay/async-trait/issues/169
+#[deny(where_clauses_object_safety)]
+pub mod issue169 {
+ use async_trait::async_trait;
+
+ #[async_trait]
+ pub trait Trait: ::core::marker::Sync {
+ async fn f(&self) {}
+ }
+
+ pub fn test(_t: &dyn Trait) {}
+}
diff --git a/tests/ui/bare-trait-object.stderr b/tests/ui/bare-trait-object.stderr
index 98cf679..f6374eb 100644
--- a/tests/ui/bare-trait-object.stderr
+++ b/tests/ui/bare-trait-object.stderr
@@ -9,3 +9,5 @@ note: the lint level is defined here
|
1 | #![deny(bare_trait_objects)]
| ^^^^^^^^^^^^^^^^^^
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
diff --git a/tests/ui/lifetime-span.stderr b/tests/ui/lifetime-span.stderr
index feae87f..ddfb267 100644
--- a/tests/ui/lifetime-span.stderr
+++ b/tests/ui/lifetime-span.stderr
@@ -3,6 +3,8 @@ error[E0726]: implicit elided lifetime not allowed here
|
12 | impl Trait for A {
| ^^^^^- help: indicate the anonymous lifetime: `<'_>`
+ |
+ = note: assuming a `'static` lifetime...
error[E0107]: this trait takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/lifetime-span.rs:32:10