Snap for 8192738 from 07ddfd341f25aa0c70fe6dc1b8f15d10fbc3e32e to tm-frc-extservices-release
Change-Id: I47a27af5a3b2147c0b449e1a7b380f1db79b1ba5
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 @@
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..3efa2b7 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,4 @@
-// This file is generated by cargo2android.py --run --device --dependencies.
+// This file is generated by cargo2android.py --config cargo2android.json.
// Do not modify this file as changes will be overridden on upgrade.
package {
@@ -40,6 +40,8 @@
rust_proc_macro {
name: "libasync_trait",
crate_name: "async_trait",
+ cargo_env_compat: true,
+ cargo_pkg_version: "0.1.51",
srcs: ["src/lib.rs"],
edition: "2018",
rustlibs: [
@@ -48,9 +50,3 @@
"libsyn",
],
}
-
-// dependent_library ["feature_list"]
-// proc-macro2-1.0.26 "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"
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 <[email protected]>"]
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 <[email protected]>"]
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 @@
}
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 @@
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/TEST_MAPPING b/TEST_MAPPING
index 0f4f93c..fc8ec65 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -2,7 +2,24 @@
{
"presubmit": [
{
+ "name": "ZipFuseTest"
+ },
+ {
"name": "authfs_device_test_src_lib"
+ },
+ {
+ "name": "virtualizationservice_device_test"
+ }
+ ],
+ "presubmit-rust": [
+ {
+ "name": "ZipFuseTest"
+ },
+ {
+ "name": "authfs_device_test_src_lib"
+ },
+ {
+ "name": "virtualizationservice_device_test"
}
]
}
diff --git a/cargo2android.json b/cargo2android.json
new file mode 100644
index 0000000..bf78496
--- /dev/null
+++ b/cargo2android.json
@@ -0,0 +1,4 @@
+{
+ "device": true,
+ "run": true
+}
\ No newline at end of file
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 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 @@
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 @@
#[async_trait]
pub trait Trait {
async fn f(&self) {
- self::f()
+ self::f();
}
}
}
@@ -1361,3 +1363,16 @@
}
}
}
+
+// 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 @@
|
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 @@
|
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