diff options
author | Jeff Vander Stoep <jeffv@google.com> | 2023-03-30 14:47:19 +0200 |
---|---|---|
committer | Jeff Vander Stoep <jeffv@google.com> | 2023-03-30 14:47:19 +0200 |
commit | 9ed73418c7e5818f08b66b5841571044657d1da8 (patch) | |
tree | a363dd20440d28c7980f38dc9158414bb4dfbe57 /src/wrapper.rs | |
parent | 051ccb49c85ff1ae79981e896778114d9c4c84ed (diff) | |
download | proc-macro2-9ed73418c7e5818f08b66b5841571044657d1da8.tar.gz |
Upgrade proc-macro2 to 1.0.54android-u-beta-1-gpl
This project was upgraded with external_updater.
Usage: tools/external_updater/updater.sh update rust/crates/proc-macro2
For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md
Test: TreeHugger
Change-Id: I4d181ea3ef5f030e4a9325c7866865a9f62cce0f
Diffstat (limited to 'src/wrapper.rs')
-rw-r--r-- | src/wrapper.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/wrapper.rs b/src/wrapper.rs index f5ec06b..00f67cd 100644 --- a/src/wrapper.rs +++ b/src/wrapper.rs @@ -40,7 +40,7 @@ impl LexError { } fn mismatch() -> ! { - panic!("stable/nightly mismatch") + panic!("compiler/fallback mismatch") } impl DeferredTokenStream { @@ -530,6 +530,16 @@ impl Span { } } + pub fn source_text(&self) -> Option<String> { + match self { + #[cfg(not(no_source_text))] + Span::Compiler(s) => s.source_text(), + #[cfg(no_source_text)] + Span::Compiler(_) => None, + Span::Fallback(s) => s.source_text(), + } + } + fn unwrap_nightly(self) -> proc_macro::Span { match self { Span::Compiler(s) => s, |