Skip to content

From<proc_macro::Span> is missing for proc_macro2::Span when DOCS_RS=1 #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wtdcode
Copy link

@wtdcode wtdcode commented May 17, 2025

Hello, I narrowed down this error when debugging our CI: https://github.com/AFLplusplus/LibAFL/actions/runs/15085325118/job/42407219490#step:5:180

Generally, as illustrated in GnomedDev/proc-macro-error-2#12 (comment) , when DOCS_RS=1, proc-macro2 will miss the implementation From<proc_macro::Span> for proc_macro2::Span (existing in wrapper.rs), causing issues to downstreams.

Note a minimum reproduction was also attached in the issue above.

This PR fixes it by adding the implementation when DOCS_RS=1 and thus wrap_proc_macro is not defined. I'm not 100% confident this is the correct place for the fix to go so any inputs are highly welcome =).

@wtdcode
Copy link
Author

wtdcode commented May 17, 2025

fatal error: cross-interpreting doctests is not currently supported by Miri.

CI failure seems not relevant to my changes.

wtdcode added a commit to AFLplusplus/LibAFL that referenced this pull request May 17, 2025
@wtdcode wtdcode mentioned this pull request May 17, 2025
1 task
@wtdcode wtdcode force-pushed the impl-proc-macro-span branch from d8ca892 to 1dbb2a7 Compare May 17, 2025 16:52
@wtdcode
Copy link
Author

wtdcode commented May 17, 2025

cargo +nightly miri test passes on my local machine, is it a nightly issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant