Snap for 8347268 from 02513ca37d36da5ecf01b3387457baf9a34d0119 to mainline-go-documentsui-release
Change-Id: I445fcfc0ec3790480e14afe829b382868019b5c4
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 71c36c5..d7f5c7b 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,6 +1,5 @@
{
"git": {
- "sha1": "20bd296e0d646e2b14626b7078e045254bed26ee"
- },
- "path_in_vcs": ""
-}
\ No newline at end of file
+ "sha1": "651ddc1131325b08c1b76ae6b65c1f23ca4cf7cf"
+ }
+}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7c80abc..4c3d289 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -12,7 +12,7 @@
strategy:
fail-fast: false
matrix:
- rust: [beta, stable, 1.45.0]
+ rust: [beta, stable, 1.40.0]
include:
- rust: nightly
rustflags: --cfg async_trait_nightly_testing
@@ -36,17 +36,7 @@
clippy:
name: Clippy
runs-on: ubuntu-latest
- if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@clippy
- run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
-
- outdated:
- name: Outdated
- runs-on: ubuntu-latest
- if: github.event_name != 'pull_request'
- steps:
- - uses: actions/checkout@v2
- - uses: dtolnay/install@cargo-outdated
- - run: cargo outdated --exit-code 1
diff --git a/Android.bp b/Android.bp
index 09676ac..22a10c5 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,4 @@
-// This file is generated by cargo2android.py --config cargo2android.json.
+// This file is generated by cargo2android.py --run --device --dependencies.
// Do not modify this file as changes will be overridden on upgrade.
package {
@@ -40,8 +40,6 @@
rust_proc_macro {
name: "libasync_trait",
crate_name: "async_trait",
- cargo_env_compat: true,
- cargo_pkg_version: "0.1.52",
srcs: ["src/lib.rs"],
edition: "2018",
rustlibs: [
@@ -50,3 +48,9 @@
"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 d09788d..e97aafa 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,17 +3,17 @@
# 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 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.
+# 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)
[package]
edition = "2018"
-rust-version = "1.39"
name = "async-trait"
-version = "0.1.52"
+version = "0.1.50"
authors = ["David Tolnay <[email protected]>"]
description = "Type erasure for async trait methods"
documentation = "https://docs.rs/async-trait"
@@ -48,5 +48,5 @@
version = "0.1.14"
[dev-dependencies.trybuild]
-version = "1.0.49"
+version = "1.0.19"
features = ["diff"]
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index c340ced..8af0b3b 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,9 +1,8 @@
[package]
name = "async-trait"
-version = "0.1.52"
+version = "0.1.50"
authors = ["David Tolnay <[email protected]>"]
edition = "2018"
-rust-version = "1.39"
license = "MIT OR Apache-2.0"
description = "Type erasure for async trait methods"
repository = "https://github.com/dtolnay/async-trait"
@@ -24,7 +23,7 @@
rustversion = "1.0"
tracing = "0.1.14"
tracing-attributes = "0.1.14"
-trybuild = { version = "1.0.49", features = ["diff"] }
+trybuild = { version = "1.0.19", features = ["diff"] }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
diff --git a/METADATA b/METADATA
index 5da1fec..4f74759 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/async-trait/async-trait-0.1.52.crate"
+ value: "https://static.crates.io/crates/async-trait/async-trait-0.1.50.crate"
}
- version: "0.1.52"
+ version: "0.1.50"
license_type: NOTICE
last_upgrade_date {
- year: 2022
- month: 3
- day: 1
+ year: 2021
+ month: 4
+ day: 21
}
}
diff --git a/README.md b/README.md
index 4753f50..c393c10 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 implementations)
+implementations, Sync if there are `&self` methods with default implementions)
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 396e4da..0f4f93c 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -2,78 +2,7 @@
{
"presubmit": [
{
- "name": "ZipFuseTest"
- },
- {
"name": "authfs_device_test_src_lib"
- },
- {
- "name": "diced_open_dice_cbor_test"
- },
- {
- "name": "diced_sample_inputs_test"
- },
- {
- "name": "diced_test"
- },
- {
- "name": "diced_utils_test"
- },
- {
- "name": "diced_vendor_test"
- },
- {
- "name": "keystore2_km_compat_test"
- },
- {
- "name": "keystore2_test"
- },
- {
- "name": "legacykeystore_test"
- },
- {
- "name": "microdroid_manager_test"
- },
- {
- "name": "virtualizationservice_device_test"
- }
- ],
- "presubmit-rust": [
- {
- "name": "ZipFuseTest"
- },
- {
- "name": "authfs_device_test_src_lib"
- },
- {
- "name": "diced_open_dice_cbor_test"
- },
- {
- "name": "diced_sample_inputs_test"
- },
- {
- "name": "diced_test"
- },
- {
- "name": "diced_utils_test"
- },
- {
- "name": "diced_vendor_test"
- },
- {
- "name": "keystore2_km_compat_test"
- },
- {
- "name": "keystore2_test"
- },
- {
- "name": "legacykeystore_test"
- },
- {
- "name": "microdroid_manager_test"
- },
- {
- "name": "virtualizationservice_device_test"
}
]
}
diff --git a/cargo2android.json b/cargo2android.json
deleted file mode 100644
index bf78496..0000000
--- a/cargo2android.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "device": true,
- "run": true
-}
\ No newline at end of file
diff --git a/src/expand.rs b/src/expand.rs
index 2f4697a..e78c6c4 100644
--- a/src/expand.rs
+++ b/src/expand.rs
@@ -125,8 +125,6 @@
parse_quote! {
#[allow(
clippy::let_unit_value,
- clippy::no_effect_underscore_binding,
- clippy::shadow_same,
clippy::type_complexity,
clippy::type_repetition_in_bounds,
clippy::used_underscore_binding
@@ -398,13 +396,7 @@
fn has_bound(supertraits: &Supertraits, marker: &Ident) -> bool {
for bound in supertraits {
if let TypeParamBound::Trait(bound) = bound {
- 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
- {
+ if bound.path.is_ident(marker) {
return true;
}
}
diff --git a/src/lib.rs b/src/lib.rs
index 3ae002a..100bee6 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 implementations) to constrain all implementors of the trait such that
+//! default implementions) 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 2230db6..f6ea327 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 2bca1fc..6f95576 100644
--- a/tests/test.rs
+++ b/tests/test.rs
@@ -1,15 +1,12 @@
#![cfg_attr(
async_trait_nightly_testing,
- feature(min_specialization, type_alias_impl_trait)
+ feature(min_specialization, min_type_alias_impl_trait)
)]
#![allow(
clippy::let_underscore_drop,
clippy::let_unit_value,
clippy::missing_panics_doc,
- clippy::missing_safety_doc,
- clippy::needless_return,
- clippy::trivially_copy_pass_by_ref,
- clippy::unused_async
+ clippy::trivially_copy_pass_by_ref
)]
use async_trait::async_trait;
@@ -1334,7 +1331,7 @@
#[async_trait]
pub trait Trait {
async fn f(&self) {
- self::f();
+ self::f()
}
}
}
@@ -1364,28 +1361,3 @@
}
}
}
-
-// 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) {}
-}
-
-// https://github.com/dtolnay/async-trait/issues/183
-pub mod issue183 {
- #![deny(clippy::shadow_same)]
-
- use async_trait::async_trait;
-
- #[async_trait]
- trait Foo {
- async fn foo(_n: i32) {}
- }
-}
diff --git a/tests/ui/bare-trait-object.stderr b/tests/ui/bare-trait-object.stderr
index 6670c48..98cf679 100644
--- a/tests/ui/bare-trait-object.stderr
+++ b/tests/ui/bare-trait-object.stderr
@@ -1,13 +1,11 @@
error: trait objects without an explicit `dyn` are deprecated
- --> tests/ui/bare-trait-object.rs:11:16
+ --> $DIR/bare-trait-object.rs:11:16
|
11 | impl Trait for Send + Sync {
| ^^^^^^^^^^^ help: use `dyn`: `dyn Send + Sync`
|
note: the lint level is defined here
- --> tests/ui/bare-trait-object.rs:1:9
+ --> $DIR/bare-trait-object.rs:1:9
|
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 <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
diff --git a/tests/ui/delimiter-span.stderr b/tests/ui/delimiter-span.stderr
index a13985d..6120262 100644
--- a/tests/ui/delimiter-span.stderr
+++ b/tests/ui/delimiter-span.stderr
@@ -1,5 +1,5 @@
error: no rules expected the token `{`
- --> tests/ui/delimiter-span.rs:17:16
+ --> $DIR/delimiter-span.rs:17:16
|
3 | macro_rules! picky {
| ------------------ when calling this macro
@@ -8,7 +8,7 @@
| ^ no rules expected this token in macro call
error: no rules expected the token `{`
- --> tests/ui/delimiter-span.rs:18:16
+ --> $DIR/delimiter-span.rs:18:16
|
3 | macro_rules! picky {
| ------------------ when calling this macro
diff --git a/tests/ui/lifetime-span.stderr b/tests/ui/lifetime-span.stderr
index aad25a7..feae87f 100644
--- a/tests/ui/lifetime-span.stderr
+++ b/tests/ui/lifetime-span.stderr
@@ -1,13 +1,11 @@
error[E0726]: implicit elided lifetime not allowed here
- --> tests/ui/lifetime-span.rs:12:6
+ --> $DIR/lifetime-span.rs:12:6
|
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
- --> tests/ui/lifetime-span.rs:32:10
+ --> $DIR/lifetime-span.rs:32:10
|
32 | impl<'r> Trait2<'r> for B {
| ^^^^^^---- help: remove these generics
@@ -15,13 +13,13 @@
| expected 0 lifetime arguments
|
note: trait defined here, with 0 lifetime parameters
- --> tests/ui/lifetime-span.rs:22:11
+ --> $DIR/lifetime-span.rs:22:11
|
22 | pub trait Trait2 {
| ^^^^^^
error[E0195]: lifetime parameters or bounds on method `method` do not match the trait declaration
- --> tests/ui/lifetime-span.rs:13:14
+ --> $DIR/lifetime-span.rs:13:14
|
8 | async fn method(&'r self);
| ---------------- lifetimes in impl do not match this method in trait
@@ -30,7 +28,7 @@
| ^^^^^^^^^^^^^ lifetimes do not match method in trait
error[E0195]: lifetime parameters or bounds on method `method` do not match the trait declaration
- --> tests/ui/lifetime-span.rs:18:14
+ --> $DIR/lifetime-span.rs:18:14
|
8 | async fn method(&'r self);
| ---------------- lifetimes in impl do not match this method in trait
@@ -39,7 +37,7 @@
| ^^^^^^^^^^^^^ lifetimes do not match method in trait
error[E0195]: lifetime parameters or bounds on method `method` do not match the trait declaration
- --> tests/ui/lifetime-span.rs:33:14
+ --> $DIR/lifetime-span.rs:33:14
|
23 | async fn method<'r>(&'r self);
| ---- lifetimes in impl do not match this method in trait
diff --git a/tests/ui/missing-async-in-impl.rs b/tests/ui/missing-async-in-impl.rs
deleted file mode 100644
index 3a5f58c..0000000
--- a/tests/ui/missing-async-in-impl.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-use async_trait::async_trait;
-
-#[async_trait]
-pub trait Trait {
- async fn method();
-}
-
-pub struct Struct;
-
-#[async_trait]
-impl Trait for Struct {
- fn method() {}
-}
-
-fn main() {}
diff --git a/tests/ui/missing-async-in-impl.stderr b/tests/ui/missing-async-in-impl.stderr
deleted file mode 100644
index e461c85..0000000
--- a/tests/ui/missing-async-in-impl.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error[E0195]: lifetime parameters or bounds on method `method` do not match the trait declaration
- --> tests/ui/missing-async-in-impl.rs:12:14
- |
-5 | async fn method();
- | -------- lifetimes in impl do not match this method in trait
-...
-12 | fn method() {}
- | ^ lifetimes do not match method in trait
diff --git a/tests/ui/missing-async-in-trait.rs b/tests/ui/missing-async-in-trait.rs
deleted file mode 100644
index 56fea7a..0000000
--- a/tests/ui/missing-async-in-trait.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-use async_trait::async_trait;
-
-#[async_trait]
-pub trait Trait {
- fn method();
-}
-
-pub struct Struct;
-
-#[async_trait]
-impl Trait for Struct {
- async fn method() {}
-}
-
-fn main() {}
diff --git a/tests/ui/missing-async-in-trait.stderr b/tests/ui/missing-async-in-trait.stderr
deleted file mode 100644
index c92c38d..0000000
--- a/tests/ui/missing-async-in-trait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error[E0195]: lifetime parameters or bounds on method `method` do not match the trait declaration
- --> tests/ui/missing-async-in-trait.rs:12:14
- |
-5 | fn method();
- | - lifetimes in impl do not match this method in trait
-...
-12 | async fn method() {}
- | ^^^^^^^^ lifetimes do not match method in trait
diff --git a/tests/ui/missing-body.stderr b/tests/ui/missing-body.stderr
index e6ddb42..2d9b09c 100644
--- a/tests/ui/missing-body.stderr
+++ b/tests/ui/missing-body.stderr
@@ -1,5 +1,5 @@
error: associated function in `impl` without body
- --> tests/ui/missing-body.rs:12:5
+ --> $DIR/missing-body.rs:12:5
|
12 | async fn f(&self);
| ^^^^^^^^^^^^^^^^^-
diff --git a/tests/ui/must-use.stderr b/tests/ui/must-use.stderr
index 1b97055..c09a51e 100644
--- a/tests/ui/must-use.stderr
+++ b/tests/ui/must-use.stderr
@@ -1,11 +1,11 @@
error: unused return value of `Interface::f` that must be used
- --> tests/ui/must-use.rs:18:5
+ --> $DIR/must-use.rs:18:5
|
18 | Thing.f();
| ^^^^^^^^^^
|
note: the lint level is defined here
- --> tests/ui/must-use.rs:1:9
+ --> $DIR/must-use.rs:1:9
|
1 | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
diff --git a/tests/ui/self-span.stderr b/tests/ui/self-span.stderr
index 2690791..9ea1bbe 100644
--- a/tests/ui/self-span.stderr
+++ b/tests/ui/self-span.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> tests/ui/self-span.rs:17:21
+ --> $DIR/self-span.rs:17:21
|
17 | let _: () = self;
| -- ^^^^ expected `()`, found struct `S`
@@ -7,13 +7,13 @@
| expected due to this
error: the `Self` constructor can only be used with tuple or unit structs
- --> tests/ui/self-span.rs:18:23
+ --> $DIR/self-span.rs:18:23
|
18 | let _: Self = Self;
| ^^^^ help: use curly brackets: `Self { /* fields */ }`
error[E0308]: mismatched types
- --> tests/ui/self-span.rs:25:21
+ --> $DIR/self-span.rs:25:21
|
25 | let _: () = self;
| -- ^^^^ expected `()`, found enum `E`
@@ -21,7 +21,7 @@
| expected due to this
error[E0533]: expected unit struct, unit variant or constant, found struct variant `Self::V`
- --> tests/ui/self-span.rs:26:23
+ --> $DIR/self-span.rs:26:23
|
26 | let _: Self = Self::V;
| ^^^^^^^
diff --git a/tests/ui/send-not-implemented.stderr b/tests/ui/send-not-implemented.stderr
index 8004de6..473a31b 100644
--- a/tests/ui/send-not-implemented.stderr
+++ b/tests/ui/send-not-implemented.stderr
@@ -1,5 +1,5 @@
error: future cannot be sent between threads safely
- --> tests/ui/send-not-implemented.rs:8:26
+ --> $DIR/send-not-implemented.rs:8:26
|
8 | async fn test(&self) {
| __________________________^
@@ -9,9 +9,9 @@
12 | | }
| |_____^ future created by async block is not `Send`
|
- = help: within `impl Future<Output = [async output]>`, the trait `Send` is not implemented for `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
- --> tests/ui/send-not-implemented.rs:11:9
+ --> $DIR/send-not-implemented.rs:11:9
|
10 | let _guard = mutex.lock().unwrap();
| ------ has type `MutexGuard<'_, ()>` which is not `Send`
@@ -22,7 +22,7 @@
= note: required for the cast to the object type `dyn Future<Output = ()> + Send`
error: future cannot be sent between threads safely
- --> tests/ui/send-not-implemented.rs:14:38
+ --> $DIR/send-not-implemented.rs:14:38
|
14 | async fn test_ret(&self) -> bool {
| ______________________________________^
@@ -33,9 +33,9 @@
19 | | }
| |_____^ future created by async block is not `Send`
|
- = help: within `impl Future<Output = [async output]>`, the trait `Send` is not implemented for `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
- --> tests/ui/send-not-implemented.rs:17:9
+ --> $DIR/send-not-implemented.rs:17:9
|
16 | let _guard = mutex.lock().unwrap();
| ------ has type `MutexGuard<'_, ()>` which is not `Send`
diff --git a/tests/ui/unreachable.rs b/tests/ui/unreachable.rs
index cac2826..f546a58 100644
--- a/tests/ui/unreachable.rs
+++ b/tests/ui/unreachable.rs
@@ -12,8 +12,8 @@
#[async_trait]
pub trait TraitFoo {
async fn f() {
- let _y = unimplemented!();
- let _z = _y;
+ let y = unimplemented!();
+ let z = y;
}
}
diff --git a/tests/ui/unreachable.stderr b/tests/ui/unreachable.stderr
index 08595e5..0b74692 100644
--- a/tests/ui/unreachable.stderr
+++ b/tests/ui/unreachable.stderr
@@ -1,13 +1,13 @@
error: unreachable statement
- --> tests/ui/unreachable.rs:16:9
+ --> $DIR/unreachable.rs:16:9
|
-15 | let _y = unimplemented!();
- | ---------------- any code following this expression is unreachable
-16 | let _z = _y;
- | ^^^^^^^^^^^^ unreachable statement
+15 | let y = unimplemented!();
+ | ---------------- any code following this expression is unreachable
+16 | let z = y;
+ | ^^^^^^^^^^ unreachable statement
|
note: the lint level is defined here
- --> tests/ui/unreachable.rs:1:9
+ --> $DIR/unreachable.rs:1:9
|
1 | #![deny(warnings)]
| ^^^^^^^^
diff --git a/tests/ui/unsupported-self.stderr b/tests/ui/unsupported-self.stderr
index 1493945..c98807e 100644
--- a/tests/ui/unsupported-self.stderr
+++ b/tests/ui/unsupported-self.stderr
@@ -1,5 +1,5 @@
error: the `Self` constructor can only be used with tuple or unit structs
- --> tests/ui/unsupported-self.rs:11:17
+ --> $DIR/unsupported-self.rs:11:17
|
11 | let _ = Self;
| ^^^^