Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Configure docs for feature gates globally#1565

Merged
akern40 merged 1 commit intorust-ndarray:masterrust-ndarray/ndarray:masterfrom
akern40:doc-features-globallyakern40/ndarray:doc-features-globallyCopy head branch name to clipboard
Jan 4, 2026
Merged

Configure docs for feature gates globally#1565
akern40 merged 1 commit intorust-ndarray:masterrust-ndarray/ndarray:masterfrom
akern40:doc-features-globallyakern40/ndarray:doc-features-globallyCopy head branch name to clipboard

Conversation

@akern40
Copy link
Collaborator

@akern40 akern40 commented Jan 4, 2026

In #1479 we used cfg_attr(docsrs, doc(cfg(feature = "..."))) to add feature-gating information to the documentation. However, this required us to "remember" this at every call site. It turns out that there is a doc(auto_cfg) setting that we can use globally to do this for us automatically.

In rust-ndarray#1479 we used `cfg_attr(docsrs, doc(cfg(feature = "...")))` to add feature-gating information to the documentation. However, this required us to "remember" this at every call site. It turns out that there is a `doc(auto_cfg)` setting that we can use globally to do this for us automatically.
@nilgoyette
Copy link
Collaborator

Good job. This is much cleaner :)

@akern40
Copy link
Collaborator Author

akern40 commented Jan 4, 2026

Thanks! I ran across it by accident while trying to figure out how we might start marking some new code as "unstable" in our documentation (for some work on #1506 that I'm hoping to start merging...).

@akern40 akern40 merged commit 6e02f15 into rust-ndarray:master Jan 4, 2026
15 checks passed
@akern40 akern40 deleted the doc-features-globally branch January 4, 2026 16:34
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.