Skip to content

chore: add docs.rs metadata to Cargo.toml and use doc_cfg#26

Merged
m4tx merged 1 commit into
mainfrom
docs-rs-metadata
Jan 9, 2026
Merged

chore: add docs.rs metadata to Cargo.toml and use doc_cfg#26
m4tx merged 1 commit into
mainfrom
docs-rs-metadata

Conversation

@m4tx

@m4tx m4tx commented Jan 9, 2026

Copy link
Copy Markdown
Collaborator

We use the nightly doc_cfg feature to automatically annotate modules as only available with specific feature flags enabled in the docs. This requires some metadata in Cargo.toml that was missing.

We use the nightly
[`doc_cfg`](https://doc.rust-lang.org/unstable-book/language-features/doc-cfg.html)
feature to automatically annotate modules as only available with
specific feature flags enabled in the docs. This requires some
metadata in Cargo.toml that was missing.
@m4tx m4tx requested a review from qwandor January 9, 2026 15:10
@m4tx

m4tx commented Jan 9, 2026

Copy link
Copy Markdown
Collaborator Author

This controls this line:

#![cfg_attr(docsrs, feature(doc_cfg))]

And causes the docs to go from this:

image

To this:

image

@m4tx m4tx merged commit 710cbc2 into main Jan 9, 2026
26 checks passed
@m4tx m4tx deleted the docs-rs-metadata branch January 9, 2026 16:01
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.

2 participants