From 79ef9ffd6f8cef95f05be71914522ef9496d8058 Mon Sep 17 00:00:00 2001 From: mio Date: Sun, 18 May 2025 00:37:54 +0800 Subject: [PATCH 1/2] From is missing when DOCS_RS=1 --- src/fallback.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fallback.rs b/src/fallback.rs index fbce9c4..d0be0a5 100644 --- a/src/fallback.rs +++ b/src/fallback.rs @@ -664,6 +664,13 @@ impl Span { } } +#[cfg(not(wrap_proc_macro))] +impl From for crate::Span { + fn from(_: proc_macro::Span) -> Self { + crate::Span::_new(Span::call_site()) + } +} + impl Debug for Span { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { #[cfg(span_locations)] From 1dbb2a7c62cd9f83b9b107f53e93b5552b9c3238 Mon Sep 17 00:00:00 2001 From: mio Date: Sun, 18 May 2025 00:43:18 +0800 Subject: [PATCH 2/2] gate it behind proc-marco feature --- src/fallback.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fallback.rs b/src/fallback.rs index d0be0a5..3b1441b 100644 --- a/src/fallback.rs +++ b/src/fallback.rs @@ -664,7 +664,7 @@ impl Span { } } -#[cfg(not(wrap_proc_macro))] +#[cfg(all(not(wrap_proc_macro), feature = "proc-macro"))] impl From for crate::Span { fn from(_: proc_macro::Span) -> Self { crate::Span::_new(Span::call_site())