summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 01:02:51 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 01:02:51 +0000
commitea43857cb00ca914445b2a3f41861022c2421ec4 (patch)
tree4a4508ee12d5c294c974a9daa49840c9e7477e9d
parentfc75cc1c721ca143dbb19e0cfd2b43c1bd94a91a (diff)
parentda12f3a1bdbfde2efa5f792640e3ba55d813eca6 (diff)
downloadasync-stream-impl-aml_wif_341610000.tar.gz
Change-Id: Ie9645caa01f70b2630e142ff425786bd0786b0a6
-rw-r--r--.cargo_vcs_info.json7
-rw-r--r--Android.bp4
-rw-r--r--Cargo.toml21
-rw-r--r--Cargo.toml.orig7
-rw-r--r--METADATA14
-rw-r--r--TEST_MAPPING3
-rw-r--r--src/lib.rs24
7 files changed, 48 insertions, 32 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 620b2af..f6454dd 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,6 @@
{
"git": {
- "sha1": "b28da881695e3c66e1782f0c2c330d4e162eb7c2"
- }
-}
+ "sha1": "bf41b9645fe39b8865da2f25edc286eb42d49ec8"
+ },
+ "path_in_vcs": "async-stream-impl"
+} \ No newline at end of file
diff --git a/Android.bp b/Android.bp
index 7e1ac13..0516029 100644
--- a/Android.bp
+++ b/Android.bp
@@ -24,7 +24,7 @@ rust_proc_macro {
name: "libasync_stream_impl",
crate_name: "async_stream_impl",
cargo_env_compat: true,
- cargo_pkg_version: "0.3.2",
+ cargo_pkg_version: "0.3.4",
srcs: ["src/lib.rs"],
edition: "2018",
rustlibs: [
@@ -32,4 +32,6 @@ rust_proc_macro {
"libquote",
"libsyn",
],
+ product_available: true,
+ vendor_available: true,
}
diff --git a/Cargo.toml b/Cargo.toml
index 44a0cb9..4b74dfb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,26 +3,25 @@
# 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"
+rust-version = "1.45"
name = "async-stream-impl"
-version = "0.3.2"
+version = "0.3.4"
authors = ["Carl Lerche <me@carllerche.com>"]
description = "proc macros for async-stream crate"
-homepage = "https://github.com/tokio-rs/async-stream"
-documentation = "https://docs.rs/async-stream-impl"
license = "MIT"
repository = "https://github.com/tokio-rs/async-stream"
[lib]
proc-macro = true
+
[dependencies.proc-macro2]
version = "1"
@@ -31,7 +30,11 @@ version = "1"
[dependencies.syn]
version = "1"
-features = ["extra-traits", "full", "visit-mut"]
+features = [
+ "full",
+ "visit-mut",
+]
+
[dev-dependencies.futures-core]
version = "0.3"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 4317fdf..fc0a8e3 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,12 +1,11 @@
[package]
name = "async-stream-impl"
-version = "0.3.2"
+version = "0.3.4"
edition = "2018"
+rust-version = "1.45"
license = "MIT"
authors = ["Carl Lerche <me@carllerche.com>"]
description = "proc macros for async-stream crate"
-documentation = "https://docs.rs/async-stream-impl"
-homepage = "https://github.com/tokio-rs/async-stream"
repository = "https://github.com/tokio-rs/async-stream"
[lib]
@@ -14,7 +13,7 @@ proc-macro = true
[dependencies]
proc-macro2 = "1"
-syn = { version = "1", features = ["extra-traits", "full", "visit-mut"]}
+syn = { version = "1", features = ["full", "visit-mut"] }
quote = "1"
[dev-dependencies]
diff --git a/METADATA b/METADATA
index f08d3d2..7fb5079 100644
--- a/METADATA
+++ b/METADATA
@@ -1,3 +1,7 @@
+# This project was upgraded with external_updater.
+# Usage: tools/external_updater/updater.sh update rust/crates/async-stream-impl
+# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md
+
name: "async-stream-impl"
description: "proc macros for async-stream crate"
third_party {
@@ -7,13 +11,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/async-stream-impl/async-stream-impl-0.3.2.crate"
+ value: "https://static.crates.io/crates/async-stream-impl/async-stream-impl-0.3.4.crate"
}
- version: "0.3.2"
+ version: "0.3.4"
license_type: NOTICE
last_upgrade_date {
- year: 2021
- month: 6
- day: 21
+ year: 2023
+ month: 3
+ day: 2
}
}
diff --git a/TEST_MAPPING b/TEST_MAPPING
index dfc3524..bbd2132 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -2,6 +2,9 @@
{
"imports": [
{
+ "path": "external/rust/crates/async-stream"
+ },
+ {
"path": "external/rust/crates/tokio"
},
{
diff --git a/src/lib.rs b/src/lib.rs
index 81d3752..7309648 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -115,6 +115,8 @@ impl VisitMut for Scrub<'_> {
syn::Expr::Yield(yield_expr) => {
self.has_yielded = true;
+ syn::visit_mut::visit_expr_yield_mut(self, yield_expr);
+
let value_expr = yield_expr.expr.as_ref().unwrap_or(&self.unit);
// let ident = &self.yielder;
@@ -172,7 +174,7 @@ impl VisitMut for Scrub<'_> {
};
#label
loop {
- let #pat = match #crate_path::reexport::next(&mut __pinned).await {
+ let #pat = match #crate_path::__private::next(&mut __pinned).await {
::core::option::Option::Some(e) => e,
::core::option::Option::None => break,
};
@@ -213,8 +215,8 @@ pub fn stream_inner(input: TokenStream) -> TokenStream {
let mut scrub = Scrub::new(false, &crate_path);
- for mut stmt in &mut stmts {
- scrub.visit_stmt_mut(&mut stmt);
+ for stmt in &mut stmts {
+ scrub.visit_stmt_mut(stmt);
}
let dummy_yield = if scrub.has_yielded {
@@ -226,8 +228,8 @@ pub fn stream_inner(input: TokenStream) -> TokenStream {
};
quote!({
- let (mut __yield_tx, __yield_rx) = #crate_path::yielder::pair();
- #crate_path::AsyncStream::new(__yield_rx, async move {
+ let (mut __yield_tx, __yield_rx) = unsafe { #crate_path::__private::yielder::pair() };
+ #crate_path::__private::AsyncStream::new(__yield_rx, async move {
#dummy_yield
#(#stmts)*
})
@@ -247,8 +249,8 @@ pub fn try_stream_inner(input: TokenStream) -> TokenStream {
let mut scrub = Scrub::new(true, &crate_path);
- for mut stmt in &mut stmts {
- scrub.visit_stmt_mut(&mut stmt);
+ for stmt in &mut stmts {
+ scrub.visit_stmt_mut(stmt);
}
let dummy_yield = if scrub.has_yielded {
@@ -260,8 +262,8 @@ pub fn try_stream_inner(input: TokenStream) -> TokenStream {
};
quote!({
- let (mut __yield_tx, __yield_rx) = #crate_path::yielder::pair();
- #crate_path::AsyncStream::new(__yield_rx, async move {
+ let (mut __yield_tx, __yield_rx) = unsafe { #crate_path::__private::yielder::pair() };
+ #crate_path::__private::AsyncStream::new(__yield_rx, async move {
#dummy_yield
#(#stmts)*
})
@@ -288,7 +290,9 @@ fn replace_for_await(input: impl IntoIterator<Item = TokenTree>) -> TokenStream2
}
TokenTree::Group(group) => {
let stream = replace_for_await(group.stream());
- tokens.push(Group::new(group.delimiter(), stream).into());
+ let mut new_group = Group::new(group.delimiter(), stream);
+ new_group.set_span(group.span());
+ tokens.push(new_group.into());
}
_ => tokens.push(token),
}