Skip to content

docs: document how semver-exempt APIs are enabled on Span::eq - #541

Open
TrueFurina wants to merge 1 commit into
dtolnay:masterfrom
TrueFurina:docs/span-eq-semver-exempt-enable
Open

TrueFurina wants to merge 1 commit into
dtolnay:masterfrom
TrueFurina:docs/span-eq-semver-exempt-enable

Conversation

@TrueFurina

Copy link
Copy Markdown

Closes #538.

Background

Span::eq is #[cfg(procmacro2_semver_exempt)] and its docs say only
"semver exempt and not exposed by default". As kevinmehall clarified in
#538, this is deliberate: semver-exempt APIs are not a Cargo feature and
must be enabled by passing --cfg procmacro2_semver_exempt in RUSTFLAGS
from the top-level crate (documented in the README's "Unstable features"
section). But nothing on the method itself points there, so downstream
users reasonably try features = ["procmacro2_semver_exempt"] and get a
version-selection error.

Change (docs-only)

Span::eq's doc comment now states the actual enablement mechanism and
links to the "Unstable features" section of the crate documentation.
No code behavior is changed.

Verification

  • Docs-only; the method is behind #[cfg(procmacro2_semver_exempt)] so the
    default build and tests are untouched

Span::eq is semver-exempt and deliberately not a Cargo feature; it is
enabled via `--cfg procmacro2_semver_exempt` in RUSTFLAGS from the
top-level crate (README "Unstable features"). The method docs said only
"not exposed by default", which led to a downstream failure trying to
enable it as a feature (dtolnay#538). Document the actual enablement mechanism
on the method itself.
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.

feature procmacro2_semver_exempt does not exist: Span::eq() is documented but not available

1 participant