Span::unstable to expose the proc_macro::Span
diff --git a/src/lib.rs b/src/lib.rs
index de3a2e5..62fa595 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -162,6 +162,12 @@
Span(imp::Span::def_site())
}
+ /// This method is only available when the `"unstable"` feature is enabled.
+ #[cfg(feature = "unstable")]
+ pub fn unstable(self) -> proc_macro::Span {
+ self.0.unstable()
+ }
+
#[cfg(procmacro2_unstable)]
pub fn source_file(&self) -> SourceFile {
SourceFile(self.0.source_file())
diff --git a/src/unstable.rs b/src/unstable.rs
index 41b9f64..56df0dd 100644
--- a/src/unstable.rs
+++ b/src/unstable.rs
@@ -225,6 +225,10 @@
Span(proc_macro::Span::def_site())
}
+ pub fn unstable(self) -> proc_macro::Span {
+ self.0
+ }
+
#[cfg(procmacro2_unstable)]
pub fn source_file(&self) -> SourceFile {
SourceFile::new(self.0.source_file())