diff options
author | Joel Galenson <jgalenson@google.com> | 2021-06-21 13:42:13 -0700 |
---|---|---|
committer | Joel Galenson <jgalenson@google.com> | 2021-06-21 13:42:13 -0700 |
commit | d363fd51c739d25cf270277693db1c4224c675e0 (patch) | |
tree | 4a6a3fc22d07fc157bf58c66fc5439dfd2081c90 /src/lib.rs | |
parent | 06b6ec01f2eef8771d1fdec278454edb63a0f528 (diff) | |
download | proc-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.rs | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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) |