aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2020-07-26 23:48:21 -0700
committerHaibo Huang <hhb@google.com>2020-07-26 23:48:21 -0700
commit7da3cc47f35f22d83c8f15440cba8c4cad2513d7 (patch)
tree58084bdcee842e096efeb46eadbbbf3546912d5f
parentc7557ca9511ab1128a51d6f3217201394084125a (diff)
downloadsyn-7da3cc47f35f22d83c8f15440cba8c4cad2513d7.tar.gz
Upgrade rust/crates/syn to 1.0.36
Change-Id: Ibd3dcfaf4ad183d8997af91cf0413470a9dfc954
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Cargo.toml2
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA4
-rw-r--r--src/lib.rs2
-rw-r--r--src/lit.rs26
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"
}
}
diff --git a/Cargo.toml b/Cargo.toml
index f677ff82..1a7cba57 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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"
diff --git a/METADATA b/METADATA
index 4f6d6e55..8b5c70d6 100644
--- a/METADATA
+++ b/METADATA
@@ -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
}
}
diff --git a/src/lib.rs b/src/lib.rs
index 0c4a6e00..f95d43da 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.35")]
+#![doc(html_root_url = "https://docs.rs/syn/1.0.36")]
#![deny(clippy::all, clippy::pedantic)]
// Ignored clippy lints.
#![allow(
diff --git a/src/lit.rs b/src/lit.rs
index 7ca37cf9..692391d9 100644
--- a/src/lit.rs
+++ b/src/lit.rs
@@ -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