aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorJoel Galenson <jgalenson@google.com>2021-06-21 13:42:13 -0700
committerJoel Galenson <jgalenson@google.com>2021-06-21 13:42:13 -0700
commitd363fd51c739d25cf270277693db1c4224c675e0 (patch)
tree4a6a3fc22d07fc157bf58c66fc5439dfd2081c90 /src/lib.rs
parent06b6ec01f2eef8771d1fdec278454edb63a0f528 (diff)
downloadproc-macro2-d363fd51c739d25cf270277693db1c4224c675e0.tar.gz
Upgrade rust/crates/proc-macro2 to 1.0.27
Test: make Change-Id: I66869c4d506555c12bd054d731e818b2aafa6720
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 9dec309..52d01f2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -78,7 +78,7 @@
//! a different thread.
// Proc-macro2 types in rustdoc of other crates get linked to here.
-#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.26")]
+#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.27")]
#![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))]
#![cfg_attr(super_unstable, feature(proc_macro_raw_ident, proc_macro_def_site))]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
@@ -1203,6 +1203,17 @@ impl Literal {
}
}
+impl FromStr for Literal {
+ type Err = LexError;
+
+ fn from_str(repr: &str) -> Result<Self, LexError> {
+ repr.parse().map(Literal::_new).map_err(|inner| LexError {
+ inner,
+ _marker: Marker,
+ })
+ }
+}
+
impl Debug for Literal {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Debug::fmt(&self.inner, f)