Skip to content

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