Update to syn-2 am: 4497fb4f59 am: a2ad5a30b1 am: 63b69f1f39

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/async-stream-impl/+/2522575

Change-Id: Idd991c8a0e23fc126242c542278cc29844c02cbb
Signed-off-by: Automerger Merge Worker <[email protected]>
diff --git a/patches/syn-2.patch b/patches/syn-2.patch
new file mode 100644
index 0000000..7a8225c
--- /dev/null
+++ b/patches/syn-2.patch
@@ -0,0 +1,36 @@
+diff --git a/src/lib.rs b/src/lib.rs
+index 7309648..03fb529 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -1,4 +1,3 @@
+-extern crate proc_macro;
+ use proc_macro::TokenStream;
+ use proc_macro2::{Group, TokenStream as TokenStream2, TokenTree};
+ use quote::quote;
+@@ -148,7 +147,7 @@ impl VisitMut for Scrub<'_> {
+             syn::Expr::ForLoop(expr) => {
+                 syn::visit_mut::visit_expr_for_loop_mut(self, expr);
+                 // TODO: Should we allow other attributes?
+-                if expr.attrs.len() != 1 || !expr.attrs[0].path.is_ident("await") {
++                if expr.attrs.len() != 1 || !expr.attrs[0].path().is_ident("await_") {
+                     return;
+                 }
+                 let syn::ExprForLoop {
+@@ -161,7 +160,7 @@ impl VisitMut for Scrub<'_> {
+                 } = expr;
+ 
+                 let attr = attrs.pop().unwrap();
+-                if let Err(e) = syn::parse2::<syn::parse::Nothing>(attr.tokens) {
++                if let Err(e) = attr.meta.require_path_only() {
+                     *i = syn::parse2(e.to_compile_error()).unwrap();
+                     return;
+                 }
+@@ -281,7 +280,7 @@ fn replace_for_await(input: impl IntoIterator<Item = TokenTree>) -> TokenStream2
+             TokenTree::Ident(ident) => {
+                 match input.peek() {
+                     Some(TokenTree::Ident(next)) if ident == "for" && next == "await" => {
+-                        tokens.extend(quote!(#[#next]));
++                        tokens.extend(quote!(#[await_]));
+                         let _ = input.next();
+                     }
+                     _ => {}
diff --git a/src/lib.rs b/src/lib.rs
index 7309648..d3aafa9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -148,7 +148,7 @@
             syn::Expr::ForLoop(expr) => {
                 syn::visit_mut::visit_expr_for_loop_mut(self, expr);
                 // TODO: Should we allow other attributes?
-                if expr.attrs.len() != 1 || !expr.attrs[0].path.is_ident("await") {
+                if expr.attrs.len() != 1 || !expr.attrs[0].path().is_ident("await_") {
                     return;
                 }
                 let syn::ExprForLoop {
@@ -161,7 +161,7 @@
                 } = expr;
 
                 let attr = attrs.pop().unwrap();
-                if let Err(e) = syn::parse2::<syn::parse::Nothing>(attr.tokens) {
+                if let Err(e) = attr.meta.require_path_only() {
                     *i = syn::parse2(e.to_compile_error()).unwrap();
                     return;
                 }
@@ -281,7 +281,7 @@
             TokenTree::Ident(ident) => {
                 match input.peek() {
                     Some(TokenTree::Ident(next)) if ident == "for" && next == "await" => {
-                        tokens.extend(quote!(#[#next]));
+                        tokens.extend(quote!(#[await_]));
                         let _ = input.next();
                     }
                     _ => {}