diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ecf9cbb..38062af8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,8 +104,15 @@ jobs: cache: false # Do the actual formatting check. - # `-D warnings` promotes all warnings to errors which leads to failure - - name: Build documentation for validation + # `-D warnings` promotes all warnings to errors which leads to failure. + # No features explicitly enabled. + - name: Build documentation for validation (no feature flag) + run: | + RUSTDOCFLAGS="-D warnings" \ + cargo doc --no-deps + + # All features enabled. + - name: Build documentation for validation (--all-features) run: | RUSTDOCFLAGS="-D warnings" \ cargo doc --no-deps --all-features diff --git a/src/base/name/absolute.rs b/src/base/name/absolute.rs index a923b802..8b18da09 100644 --- a/src/base/name/absolute.rs +++ b/src/base/name/absolute.rs @@ -170,11 +170,12 @@ impl Name { /// This function will work for any kind octets sequence that can be /// created from an octets slice. Since this will require providing the /// type parameter in some cases, there are shortcuts methods for specific - /// octets types: [`root_ref`], [`root_vec`], and [`root_bytes`]. + /// octets types: [`root_ref`], [`root_vec`], and + #[cfg_attr(feature = "bytes", doc = " [`root_bytes`][Name::root_bytes].")] + #[cfg_attr(not(feature = "bytes"), doc = " `root_bytes`.")] /// /// [`root_ref`]: Name::root_ref /// [`root_vec`]: Name::root_vec - /// [`root_bytes`]: Name::root_bytes #[must_use] pub fn root() -> Self where diff --git a/src/utils/dst.rs b/src/utils/dst.rs index cc47a581..e5d9a43a 100644 --- a/src/utils/dst.rs +++ b/src/utils/dst.rs @@ -5,11 +5,14 @@ //! relatively good support for DSTs (e.g. they can be held by reference like //! any other type), it has some rough edges. The standard library tries to //! paper over these with helpful functions and trait impls, but it does not -//! account for custom DST types. In particular, [`new::base`] introduces a -//! large number of user-facing DSTs and needs to paper over the same rough -//! edges for all of them. -//! -//! [`new::base`]: crate::new::base +//! account for custom DST types. In particular, +#![cfg_attr( + feature = "unstable-new", + doc = " [`new::base`][crate::new::base]" +)] +#![cfg_attr(not(feature = "unstable-new"), doc = " `new::base`")] +//! introduces a large number of user-facing DSTs and needs to paper over the +//! same rough edges for all of them. //! //! ## Coping DSTs //! @@ -18,7 +21,7 @@ //! Copying a DST into new container (e.g. [`Box`]) requires explicit support //! from that container type. //! -//! [`Box`]: https://doc.rust-lang.org/std/boxed/struct.Box.html +//! [`Box`]: std::boxed::Box //! //! This module introduces the [`UnsizedCopy`] trait (and a derive macro) that //! types like [`str`] implement. Container types that can support copying