diff --git a/crates/uffs-client/src/lib.rs b/crates/uffs-client/src/lib.rs index 0fa9479ef..8e4a8f748 100644 --- a/crates/uffs-client/src/lib.rs +++ b/crates/uffs-client/src/lib.rs @@ -34,6 +34,13 @@ //! `uffs-cli`. //! - **§3.7** N/A — no `pub trait` declarations in this crate. +// On docs.rs only: enable the `doc_cfg` rustdoc feature so cfg-gated items +// (`#[cfg(feature = "async")]`, `#[cfg(windows)]`, etc.) render with their +// cfg badge. Gated behind `cfg(docsrs)` so local `cargo doc` never +// exercises the nightly-only feature. Post-Rust-1.92 the `doc_auto_cfg` +// feature was merged into `doc_cfg` (rust-lang/rust#138907). +#![cfg_attr(docsrs, feature(doc_cfg))] + // Suppress unused crate warnings for deps used in sub-modules use serde as _; use uffs_security as _; diff --git a/crates/uffs-mcp/src/lib.rs b/crates/uffs-mcp/src/lib.rs index a3ae82000..1c4fffe34 100644 --- a/crates/uffs-mcp/src/lib.rs +++ b/crates/uffs-mcp/src/lib.rs @@ -26,6 +26,13 @@ //! # } //! ``` +// On docs.rs only: enable the `doc_cfg` rustdoc feature so cfg-gated items +// render with their cfg badge. Gated behind `cfg(docsrs)` so local +// `cargo doc` never exercises the nightly-only feature. Post-Rust-1.92 +// the `doc_auto_cfg` feature was merged into `doc_cfg` +// (rust-lang/rust#138907). +#![cfg_attr(docsrs, feature(doc_cfg))] + // `clap` is used by the `uffsmcp` binary, not this library crate. use clap as _; diff --git a/crates/uffs-mft/src/lib.rs b/crates/uffs-mft/src/lib.rs index 54682d970..11282897c 100644 --- a/crates/uffs-mft/src/lib.rs +++ b/crates/uffs-mft/src/lib.rs @@ -90,6 +90,12 @@ //! No `pub trait` declarations live in this crate, so the //! sealed-trait decision (§3.7) is **N/A**. +// On docs.rs only: enable the `doc_cfg` rustdoc feature so cfg-gated items +// (`#[cfg(windows)]`, `#[cfg(feature = "...")]`, etc.) render with their +// cfg badge. Gated behind `cfg(docsrs)` so local `cargo doc` never +// exercises the nightly-only feature. Post-Rust-1.92 the `doc_auto_cfg` +// feature was merged into `doc_cfg` (rust-lang/rust#138907). +#![cfg_attr(docsrs, feature(doc_cfg))] #![warn(clippy::all, clippy::pedantic)] #![expect( clippy::module_name_repetitions, diff --git a/crates/uffs-text/src/lib.rs b/crates/uffs-text/src/lib.rs index 625aa2040..92140a132 100644 --- a/crates/uffs-text/src/lib.rs +++ b/crates/uffs-text/src/lib.rs @@ -32,4 +32,11 @@ //! - Locale-aware collation //! - Search tokenisation +// On docs.rs only: enable the `doc_cfg` rustdoc feature so cfg-gated items +// render with their cfg badge. Gated behind `cfg(docsrs)` so local +// `cargo doc` never exercises the nightly-only feature. Post-Rust-1.92 +// the `doc_auto_cfg` feature was merged into `doc_cfg` +// (rust-lang/rust#138907) — `doc_cfg` is now the unified name. +#![cfg_attr(docsrs, feature(doc_cfg))] + pub mod case_fold; diff --git a/crates/uffs-time/src/lib.rs b/crates/uffs-time/src/lib.rs index c70eed1a8..1c9449d85 100644 --- a/crates/uffs-time/src/lib.rs +++ b/crates/uffs-time/src/lib.rs @@ -39,6 +39,15 @@ //! site. Future sub-phases may push [`Filetime`] deeper into the index //! / query layers. +// On docs.rs only: enable the `doc_cfg` rustdoc feature so cfg-gated items +// (e.g. `#[cfg(feature = "...")]` or `#[cfg(target_os = "...")]`) render +// with their cfg badge on the rendered docs. Gated behind `cfg(docsrs)` +// so local `cargo doc` (which doesn't pass `--cfg docsrs`) never exercises +// the nightly-only feature. See `[package.metadata.docs.rs]` in Cargo.toml +// for the cfg wiring. The previously-used `doc_auto_cfg` feature was +// merged into `doc_cfg` in Rust 1.92 (rust-lang/rust#138907); the unified +// `doc_cfg` feature preserves the automatic cfg-badge inference behaviour. +#![cfg_attr(docsrs, feature(doc_cfg))] #![no_std] /// Number of 100-nanosecond intervals per second.