diff --git a/src/extra.rs b/src/extra.rs
index e9bf9db..d3496f2 100644
--- a/src/extra.rs
+++ b/src/extra.rs
@@ -7,9 +7,28 @@ use crate::marker::{ProcMacroAutoTraits, MARKER};
use crate::Span;
use core::fmt::{self, Debug};
+/// Invalidate any `proc_macro2::Span` that exist on the current thread.
+///
+/// The implementation of `Span` uses thread-local data structures and this
+/// function clears them. Calling any method on a `Span` on the current thread
+/// created prior to the invalidation will return incorrect values or crash.
+///
+/// This function is useful for programs that process more than 232
+/// bytes of Rust source code on the same thread. Just like rustc, proc-macro2
+/// uses 32-bit source locations, and these wrap around when the total source
+/// code processed by the same thread exceeds 232 bytes (4
+/// gigabytes). After a wraparound, `Span` methods such as `source_text()` can
+/// return wrong data.
+///
+/// # Panics
+///
+/// This function is not applicable to and will panic if called from a
+/// procedural macro.
#[cfg(span_locations)]
#[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))]
-pub use crate::imp::invalidate_current_thread_spans;
+pub fn invalidate_current_thread_spans() {
+ crate::imp::invalidate_current_thread_spans();
+}
/// An object that holds a [`Group`]'s `span_open()` and `span_close()` together
/// in a more compact representation than holding those 2 spans individually.
diff --git a/src/fallback.rs b/src/fallback.rs
index 71454ec..f26d156 100644
--- a/src/fallback.rs
+++ b/src/fallback.rs
@@ -335,7 +335,7 @@ thread_local! {
}
#[cfg(span_locations)]
-pub fn invalidate_current_thread_spans() {
+pub(crate) fn invalidate_current_thread_spans() {
#[cfg(not(fuzzing))]
SOURCE_MAP.with(|sm| sm.borrow_mut().files.truncate(1));
}
diff --git a/src/wrapper.rs b/src/wrapper.rs
index 28900e0..5169dca 100644
--- a/src/wrapper.rs
+++ b/src/wrapper.rs
@@ -929,25 +929,8 @@ impl Debug for Literal {
}
}
-/// Invalidate any `proc_macro2::Span` that exist on the current thread.
-///
-/// The implementation of `Span` uses thread-local data structures and this
-/// function clears them. Calling any method on a `Span` on the current thread
-/// created prior to the invalidation will return incorrect values or crash.
-///
-/// This function is useful for programs that process more than 232
-/// bytes of Rust source code on the same thread. Just like rustc, proc-macro2
-/// uses 32-bit source locations, and these wrap around when the total source
-/// code processed by the same thread exceeds 232 bytes (4
-/// gigabytes). After a wraparound, `Span` methods such as `source_text()` can
-/// return wrong data.
-///
-/// # Panics
-///
-/// This function is not applicable to and will panic if called from a
-/// procedural macro.
#[cfg(span_locations)]
-pub fn invalidate_current_thread_spans() {
+pub(crate) fn invalidate_current_thread_spans() {
if inside_proc_macro() {
panic!(
"proc_macro2::extra::invalidate_current_thread_spans is not available in procedural macros"