diff options
author | David Tolnay <dtolnay@gmail.com> | 2019-01-16 12:13:15 -0800 |
---|---|---|
committer | David Tolnay <dtolnay@gmail.com> | 2019-01-16 12:13:22 -0800 |
commit | c0425cd7f9c240835cad1c71e53c399926659dbb (patch) | |
tree | 92337a6b01b408b5448b101996ed19ba34d1f41d /src/lib.rs | |
parent | b0778c53383771c166175d7c848e30302d24f89c (diff) | |
download | proc-macro2-c0425cd7f9c240835cad1c71e53c399926659dbb.tar.gz |
Better panic on Span::unstable outside of proc macro
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -337,6 +337,12 @@ impl Span { /// /// This method is available when building with a nightly compiler, or when /// building with rustc 1.29+ *without* semver exempt features. + /// + /// # Panics + /// + /// Panics if called from outside of a procedural macro. Unlike + /// `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 unstable(self) -> proc_macro::Span { self.inner.unstable() |