Upgrade rust/crates/syn to 1.0.35 am: c7557ca951 am: 18d4b71f48 am: 2078dd5c69 am: fd22193c64

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

Change-Id: If51b2327a626e45717666ba253f20374258d102a
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 70d33e9..bd0c707 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
 {
   "git": {
-    "sha1": "ab00f4841e5cdd463891fd4612cf1230bd69f613"
+    "sha1": "ba2b69a32471f0ca86981dc4f8ea88b0e9e58da5"
   }
 }
diff --git a/Cargo.toml b/Cargo.toml
index 67fac01..f677ff8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
 [package]
 edition = "2018"
 name = "syn"
-version = "1.0.33"
+version = "1.0.35"
 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 51d629d..606ef95 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
 [package]
 name = "syn"
-version = "1.0.33" # don't forget to update html_root_url and syn.json
+version = "1.0.35" # 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 f3a01c6..4f6d6e5 100644
--- a/METADATA
+++ b/METADATA
@@ -9,11 +9,11 @@
     type: GIT
     value: "https://github.com/dtolnay/syn"
   }
-  version: "1.0.33"
+  version: "1.0.35"
   license_type: NOTICE
   last_upgrade_date {
     year: 2020
     month: 7
-    day: 10
+    day: 20
   }
 }
diff --git a/README.md b/README.md
index e24b2ce..12b5f45 100644
--- a/README.md
+++ b/README.md
@@ -46,10 +46,6 @@
 [`syn::DeriveInput`]: https://docs.rs/syn/1.0/syn/struct.DeriveInput.html
 [parser functions]: https://docs.rs/syn/1.0/syn/parse/index.html
 
-If you get stuck with anything involving procedural macros in Rust I am happy to
-provide help even if the issue is not related to Syn. Please file a ticket in
-this repo.
-
 *Version requirement: Syn supports rustc 1.31 and up.*
 
 [*Release notes*](https://github.com/dtolnay/syn/releases)
diff --git a/benches/rust.rs b/benches/rust.rs
index ab37e68..ba9a3d4 100644
--- a/benches/rust.rs
+++ b/benches/rust.rs
@@ -59,7 +59,7 @@
             }
         }
 
-        rustc_ast::with_globals(Edition::Edition2018, || {
+        rustc_ast::with_session_globals(Edition::Edition2018, || {
             let cm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
             let emitter = Box::new(SilentEmitter);
             let handler = Handler::with_emitter(false, None, emitter);
diff --git a/src/expr.rs b/src/expr.rs
index 2b51dfb..8a832e0 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -1774,7 +1774,7 @@
                     e = Expr::Field(ExprField {
                         attrs: Vec::new(),
                         base: Box::new(e),
-                        dot_token: input.parse()?,
+                        dot_token,
                         member: input.parse()?,
                     });
                 }
diff --git a/src/file.rs b/src/file.rs
index 29a4a14..c8fab63 100644
--- a/src/file.rs
+++ b/src/file.rs
@@ -37,6 +37,8 @@
     ///     file.read_to_string(&mut src).expect("Unable to read file");
     ///
     ///     let syntax = syn::parse_file(&src).expect("Unable to parse file");
+    ///
+    ///     // Debug impl is available if Syn is built with "extra-traits" feature.
     ///     println!("{:#?}", syntax);
     /// }
     /// ```
diff --git a/src/lib.rs b/src/lib.rs
index 1e941a0..0c4a6e0 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.33")]
+#![doc(html_root_url = "https://docs.rs/syn/1.0.35")]
 #![deny(clippy::all, clippy::pedantic)]
 // Ignored clippy lints.
 #![allow(
@@ -261,6 +261,7 @@
     clippy::inherent_to_string,
     clippy::large_enum_variant,
     clippy::manual_non_exhaustive,
+    clippy::match_like_matches_macro,
     clippy::match_on_vec_items,
     clippy::needless_doctest_main,
     clippy::needless_pass_by_value,
@@ -280,6 +281,7 @@
     clippy::missing_errors_doc,
     clippy::module_name_repetitions,
     clippy::must_use_candidate,
+    clippy::option_if_let_else,
     clippy::shadow_unrelated,
     clippy::similar_names,
     clippy::single_match_else,
diff --git a/src/parse_macro_input.rs b/src/parse_macro_input.rs
index fbf9270..c8fc1ce 100644
--- a/src/parse_macro_input.rs
+++ b/src/parse_macro_input.rs
@@ -43,6 +43,30 @@
 /// #   "".parse().unwrap()
 /// }
 /// ```
+///
+/// <br>
+///
+/// # Expansion
+///
+/// `parse_macro_input!($variable as $Type)` expands to something like:
+///
+/// ```no_run
+/// # extern crate proc_macro;
+/// #
+/// # macro_rules! doc_test {
+/// #     ($variable:ident as $Type:ty) => {
+/// match syn::parse::<$Type>($variable) {
+///     Ok(syntax_tree) => syntax_tree,
+///     Err(err) => return proc_macro::TokenStream::from(err.to_compile_error()),
+/// }
+/// #     };
+/// # }
+/// #
+/// # fn test(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+/// #     let _ = doc_test!(input as syn::Ident);
+/// #     proc_macro::TokenStream::new()
+/// # }
+/// ```
 #[macro_export]
 macro_rules! parse_macro_input {
     ($tokenstream:ident as $ty:ty) => {
diff --git a/tests/common/eq.rs b/tests/common/eq.rs
index 794fe4a..247a58b 100644
--- a/tests/common/eq.rs
+++ b/tests/common/eq.rs
@@ -335,7 +335,7 @@
 spanless_eq_enum!(GenericArg; Lifetime(0) Type(0) Const(0));
 spanless_eq_enum!(GenericArgs; AngleBracketed(0) Parenthesized(0));
 spanless_eq_enum!(GenericBound; Trait(0 1) Outlives(0));
-spanless_eq_enum!(GenericParamKind; Lifetime Type(default) Const(ty));
+spanless_eq_enum!(GenericParamKind; Lifetime Type(default) Const(ty kw_span));
 spanless_eq_enum!(ImplPolarity; Positive Negative(0));
 spanless_eq_enum!(InlineAsmRegOrRegClass; Reg(0) RegClass(0));
 spanless_eq_enum!(InlineAsmTemplatePiece; String(0) Placeholder(operand_idx modifier span));
@@ -442,8 +442,8 @@
                 continue;
             }
         };
-        let contents = comments::strip_doc_comment_decoration(&c.as_str());
-        let style = comments::doc_comment_style(&c.as_str());
+        let contents = comments::strip_doc_comment_decoration(c);
+        let style = comments::doc_comment_style(c);
         tokens.push(TokenTree::token(TokenKind::Pound, DUMMY_SP));
         if style == AttrStyle::Inner {
             tokens.push(TokenTree::token(TokenKind::Not, DUMMY_SP));
diff --git a/tests/test_precedence.rs b/tests/test_precedence.rs
index 835a44d..d74d96d 100644
--- a/tests/test_precedence.rs
+++ b/tests/test_precedence.rs
@@ -156,7 +156,7 @@
     let mut passed = 0;
     let mut failed = 0;
 
-    rustc_ast::with_globals(edition, || {
+    rustc_ast::with_session_globals(edition, || {
         for expr in exprs {
             let raw = quote!(#expr).to_string();
 
diff --git a/tests/test_round_trip.rs b/tests/test_round_trip.rs
index 26d36da..99268a7 100644
--- a/tests/test_round_trip.rs
+++ b/tests/test_round_trip.rs
@@ -79,7 +79,7 @@
             let edition = repo::edition(path).parse().unwrap();
 
             let equal = panic::catch_unwind(|| {
-                rustc_ast::with_globals(edition, || {
+                rustc_ast::with_session_globals(edition, || {
                     let sess = ParseSess::new(FilePathMapping::empty());
                     let before = match librustc_parse(content, &sess) {
                         Ok(before) => before,