Skip to content
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

Docs: add #[doc(cfg(feature = "...')) to feature-gated structs and trait impls #293

Merged

Conversation

FreezyLemon
Copy link
Contributor

This will add a note "Available on crate feature <...> only." to feature-gated structs, impls etc.

One random example of another crate that uses this is tokio. If you want to try it locally, you can run

cargo +nightly rustdoc --open -- --cfg docsrs

and it should show that some distributions need nalgebra, and that the trait implementations for rand::Distribution need the rand feature.

This will add a note "Available on crate feature <...> only."
to feature-gated structs, impls etc.
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.94%. Comparing base (c866d42) to head (656f1c7).
Report is 13 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #293   +/-   ##
=======================================
  Coverage   93.94%   93.94%           
=======================================
  Files          52       52           
  Lines       11783    11783           
=======================================
  Hits        11070    11070           
  Misses        713      713           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@YeungOnion
Copy link
Contributor

Thanks for this, was wondering if there was a way to not manually include it as a note in the docstring.

@YeungOnion YeungOnion merged commit 3c3cb4d into statrs-dev:master Sep 17, 2024
11 checks passed
@FreezyLemon FreezyLemon deleted the add-doc-cfg-feature-attributes branch September 17, 2024 23:10
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