Skip to content

Commit

Permalink
Add feature indicators to docs.rs documentation
Browse files Browse the repository at this point in the history
Shows what feature must be enabled for each method to be available
  • Loading branch information
faern committed Feb 4, 2025
1 parent 5a73583 commit dcd3525
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ unexpected_cfgs = { level = "deny", check-cfg = ['cfg(oneshot_loom)', 'cfg(onesh
[[bench]]
name = "benches"
harness = false

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@

#![deny(rust_2018_idioms)]
#![cfg_attr(not(feature = "std"), no_std)]
// Enables this nightly only feature for the documentation build on docs.rs.
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

#[cfg(not(oneshot_loom))]
extern crate alloc;
Expand Down

0 comments on commit dcd3525

Please sign in to comment.