Rename Span::unstable to Span::unwrap
diff --git a/src/lib.rs b/src/lib.rs
index fd49f01..fc12835 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -344,8 +344,15 @@
/// `proc_macro2::Span`, the `proc_macro::Span` type can only exist within
/// the context of a procedural macro invocation.
#[cfg(wrap_proc_macro)]
+ pub fn unwrap(self) -> proc_macro::Span {
+ self.inner.unwrap()
+ }
+
+ // Soft deprecated. Please use Span::unwrap.
+ #[cfg(wrap_proc_macro)]
+ #[doc(hidden)]
pub fn unstable(self) -> proc_macro::Span {
- self.inner.unstable()
+ self.unwrap()
}
/// The original source file into which this span points.
diff --git a/src/wrapper.rs b/src/wrapper.rs
index 8ead052..f2121be 100644
--- a/src/wrapper.rs
+++ b/src/wrapper.rs
@@ -460,7 +460,7 @@
}
}
- pub fn unstable(self) -> proc_macro::Span {
+ pub fn unwrap(self) -> proc_macro::Span {
match self {
Span::Compiler(s) => s,
Span::Fallback(_) => panic!("proc_macro::Span is only available in procedural macros"),