aboutsummaryrefslogtreecommitdiff
path: root/src/wrapper.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wrapper.rs')
-rw-r--r--src/wrapper.rs12
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,