Upgrade rust/crates/syn to 1.0.30 am: 333e704e79

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/syn/+/1322358

Change-Id: I2e55a96ab28cecf15de6a530f774990cc36e8bbf
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 9e29726..0808224 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
 {
   "git": {
-    "sha1": "b30011c1ffc5bf6eb9a020d2599cd9268880ecc9"
+    "sha1": "89658fc242ee17041a4e2dd74b455f8d89d5de31"
   }
 }
diff --git a/Cargo.toml b/Cargo.toml
index 5205808..7d8c8a9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
 [package]
 edition = "2018"
 name = "syn"
-version = "1.0.29"
+version = "1.0.30"
 authors = ["David Tolnay <dtolnay@gmail.com>"]
 include = ["/benches/**", "/build.rs", "/Cargo.toml", "/LICENSE-APACHE", "/LICENSE-MIT", "/README.md", "/src/**", "/tests/**"]
 description = "Parser for Rust source code"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 1744351..55d82ed 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
 [package]
 name = "syn"
-version = "1.0.29" # don't forget to update html_root_url and syn.json
+version = "1.0.30" # don't forget to update html_root_url and syn.json
 authors = ["David Tolnay <dtolnay@gmail.com>"]
 license = "MIT OR Apache-2.0"
 description = "Parser for Rust source code"
diff --git a/METADATA b/METADATA
index 810405d..0b51e9e 100644
--- a/METADATA
+++ b/METADATA
@@ -9,11 +9,11 @@
     type: GIT
     value: "https://github.com/dtolnay/syn"
   }
-  version: "1.0.29"
+  version: "1.0.30"
   license_type: NOTICE
   last_upgrade_date {
     year: 2020
-    month: 5
-    day: 29
+    month: 6
+    day: 2
   }
 }
diff --git a/src/attr.rs b/src/attr.rs
index 2a51c38..d8a9d87 100644
--- a/src/attr.rs
+++ b/src/attr.rs
@@ -505,7 +505,7 @@
         fn is_outer(attr: &&Attribute) -> bool {
             match attr.style {
                 AttrStyle::Outer => true,
-                _ => false,
+                AttrStyle::Inner(_) => false,
             }
         }
         self.into_iter().filter(is_outer)
@@ -515,7 +515,7 @@
         fn is_inner(attr: &&Attribute) -> bool {
             match attr.style {
                 AttrStyle::Inner(_) => true,
-                _ => false,
+                AttrStyle::Outer => false,
             }
         }
         self.into_iter().filter(is_inner)
diff --git a/src/buffer.rs b/src/buffer.rs
index 73255d6..00aaa7d 100644
--- a/src/buffer.rs
+++ b/src/buffer.rs
@@ -201,13 +201,13 @@
         Cursor::create(self.ptr.offset(1), self.scope)
     }
 
-    /// If the cursor is looking at a `None`-delimited group, move it to look at
-    /// the first token inside instead. If the group is empty, this will move
+    /// While the cursor is looking at a `None`-delimited group, move it to look
+    /// at the first token inside instead. If the group is empty, this will move
     /// the cursor past the `None`-delimited group.
     ///
     /// WARNING: This mutates its argument.
     fn ignore_none(&mut self) {
-        if let Entry::Group(group, buf) = self.entry() {
+        while let Entry::Group(group, buf) = self.entry() {
             if group.delimiter() == Delimiter::None {
                 // NOTE: We call `Cursor::create` here to make sure that
                 // situations where we should immediately exit the span after
@@ -215,6 +215,8 @@
                 unsafe {
                     *self = Cursor::create(&buf.data[0], self.scope);
                 }
+            } else {
+                break;
             }
         }
     }
diff --git a/src/expr.rs b/src/expr.rs
index 6f14cbc..d98cc61 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -1691,7 +1691,11 @@
     // interactions, as they are fully contained.
     #[cfg(feature = "full")]
     fn atom_expr(input: ParseStream, allow_struct: AllowStruct) -> Result<Expr> {
-        if input.peek(token::Group) && !input.peek2(Token![::]) && !input.peek2(Token![!]) {
+        if input.peek(token::Group)
+            && !input.peek2(Token![::])
+            && !input.peek2(Token![!])
+            && !input.peek2(token::Brace)
+        {
             input.call(expr_group).map(Expr::Group)
         } else if input.peek(Lit) {
             input.parse().map(Expr::Lit)
diff --git a/src/gen/fold.rs b/src/gen/fold.rs
index b472d14..ec1bcfd 100644
--- a/src/gen/fold.rs
+++ b/src/gen/fold.rs
@@ -2,6 +2,7 @@
 // It is not intended for manual editing.
 
 #![allow(unreachable_code, unused_variables)]
+#![allow(clippy::match_wildcard_for_single_variants)]
 #[cfg(any(feature = "full", feature = "derive"))]
 use crate::gen::helper::fold::*;
 #[cfg(any(feature = "full", feature = "derive"))]
diff --git a/src/lib.rs b/src/lib.rs
index c84d4f9..33926fd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -250,7 +250,7 @@
 //!   dynamic library libproc_macro from rustc toolchain.
 
 // Syn types in rustdoc of other crates get linked to here.
-#![doc(html_root_url = "https://docs.rs/syn/1.0.29")]
+#![doc(html_root_url = "https://docs.rs/syn/1.0.30")]
 #![deny(clippy::all, clippy::pedantic)]
 // Ignored clippy lints.
 #![allow(
diff --git a/src/ty.rs b/src/ty.rs
index 8383bec..ed263e6 100644
--- a/src/ty.rs
+++ b/src/ty.rs
@@ -529,7 +529,7 @@
                                         ..trait_bound
                                     })
                                 }
-                                other => other,
+                                other @ TypeParamBound::Lifetime(_) => other,
                             }
                         }
                         _ => break,
diff --git a/tests/test_expr.rs b/tests/test_expr.rs
index 481ee3d..85d09d3 100644
--- a/tests/test_expr.rs
+++ b/tests/test_expr.rs
@@ -142,3 +142,25 @@
     }
     "###);
 }
+
+#[test]
+fn test_macro_variable_struct() {
+    // mimics the token stream corresponding to `$struct {}`
+    let tokens = TokenStream::from_iter(vec![
+        TokenTree::Group(Group::new(Delimiter::None, quote! { S })),
+        TokenTree::Group(Group::new(Delimiter::Brace, TokenStream::new())),
+    ]);
+
+    snapshot!(tokens as Expr, @r###"
+    Expr::Struct {
+        path: Path {
+            segments: [
+                PathSegment {
+                    ident: "S",
+                    arguments: None,
+                },
+            ],
+        },
+    }
+    "###);
+}
diff --git a/tests/test_lit.rs b/tests/test_lit.rs
index 4435aad..0bd170c 100644
--- a/tests/test_lit.rs
+++ b/tests/test_lit.rs
@@ -1,5 +1,9 @@
-use proc_macro2::{Span, TokenStream, TokenTree};
+#[macro_use]
+mod macros;
+
+use proc_macro2::{Delimiter, Group, Literal, Span, TokenStream, TokenTree};
 use quote::ToTokens;
+use std::iter::FromIterator;
 use std::str::FromStr;
 use syn::{Lit, LitFloat, LitInt};
 
@@ -229,3 +233,16 @@
     assert_eq!(get_suffix("1.0f32"), "f32");
     assert_eq!(get_suffix("1.0_f32"), "f32");
 }
+
+#[test]
+fn test_deep_group_empty() {
+    let tokens = TokenStream::from_iter(vec![TokenTree::Group(Group::new(
+        Delimiter::None,
+        TokenStream::from_iter(vec![TokenTree::Group(Group::new(
+            Delimiter::None,
+            TokenStream::from_iter(vec![TokenTree::Literal(Literal::string("hi"))]),
+        ))]),
+    ))]);
+
+    snapshot!(tokens as Lit, @r#""hi""# );
+}