diff options
author | Haibo Huang <hhb@google.com> | 2020-07-26 23:48:21 -0700 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2020-07-26 23:48:21 -0700 |
commit | 7da3cc47f35f22d83c8f15440cba8c4cad2513d7 (patch) | |
tree | 58084bdcee842e096efeb46eadbbbf3546912d5f | |
parent | c7557ca9511ab1128a51d6f3217201394084125a (diff) | |
download | syn-7da3cc47f35f22d83c8f15440cba8c4cad2513d7.tar.gz |
Upgrade rust/crates/syn to 1.0.36
Change-Id: Ibd3dcfaf4ad183d8997af91cf0413470a9dfc954
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 4 | ||||
-rw-r--r-- | src/lib.rs | 2 | ||||
-rw-r--r-- | src/lit.rs | 26 |
6 files changed, 32 insertions, 6 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index bd0c7077..ed9210da 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "ba2b69a32471f0ca86981dc4f8ea88b0e9e58da5" + "sha1": "8b460ba0294625a5b9069ad361cdac5d30689a7d" } } @@ -13,7 +13,7 @@ [package] edition = "2018" name = "syn" -version = "1.0.35" +version = "1.0.36" 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 606ef950..509e2c0d 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "syn" -version = "1.0.35" # don't forget to update html_root_url and syn.json +version = "1.0.36" # 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" @@ -9,11 +9,11 @@ third_party { type: GIT value: "https://github.com/dtolnay/syn" } - version: "1.0.35" + version: "1.0.36" license_type: NOTICE last_upgrade_date { year: 2020 month: 7 - day: 20 + day: 26 } } @@ -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.35")] +#![doc(html_root_url = "https://docs.rs/syn/1.0.36")] #![deny(clippy::all, clippy::pedantic)] // Ignored clippy lints. #![allow( @@ -993,6 +993,32 @@ mod value { Lit::Bool(_) | Lit::Verbatim(_) => "", } } + + pub fn span(&self) -> Span { + match self { + Lit::Str(lit) => lit.span(), + Lit::ByteStr(lit) => lit.span(), + Lit::Byte(lit) => lit.span(), + Lit::Char(lit) => lit.span(), + Lit::Int(lit) => lit.span(), + Lit::Float(lit) => lit.span(), + Lit::Bool(lit) => lit.span, + Lit::Verbatim(lit) => lit.span(), + } + } + + pub fn set_span(&mut self, span: Span) { + match self { + Lit::Str(lit) => lit.set_span(span), + Lit::ByteStr(lit) => lit.set_span(span), + Lit::Byte(lit) => lit.set_span(span), + Lit::Char(lit) => lit.set_span(span), + Lit::Int(lit) => lit.set_span(span), + Lit::Float(lit) => lit.set_span(span), + Lit::Bool(lit) => lit.span = span, + Lit::Verbatim(lit) => lit.set_span(span), + } + } } /// Get the byte at offset idx, or a default of `b'\0'` if we're looking |