From 523de2c28ee4457d41c047433eeae328c1d6f644 Mon Sep 17 00:00:00 2001 From: LilithSilver <84940819+LilithSilver@users.noreply.github.com> Date: Wed, 7 Jan 2026 13:14:49 -0800 Subject: [PATCH 1/3] Change doc_auto_cfg feature to doc_cfg --- lib/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/lib.rs b/lib/src/lib.rs index ccef77a..2e793c9 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -144,7 +144,7 @@ //! [wrapping]: struct.Specification.html#structfield.wrap #![no_std] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg))] #[cfg(feature = "alloc")] extern crate alloc; From e475467c3e8e7ed5042462d97bfe870a9530bee7 Mon Sep 17 00:00:00 2001 From: Julien Cretin Date: Thu, 8 Jan 2026 09:39:31 +0100 Subject: [PATCH 2/3] Fix CI to use --cfg=docsrs when needed --- .github/workflows/ci.yml | 2 +- lib/Cargo.toml | 2 +- xtask/src/main.rs | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3361b56..8123939 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,7 +188,7 @@ jobs: working-directory: lib/v3 - name: cd lib && cargo +nightly doc env: - RUSTDOCFLAGS: --deny=warnings + RUSTDOCFLAGS: --deny=warnings --cfg=docsrs run: cargo +nightly doc working-directory: lib - name: cd lib/v3 && cargo +nightly miri test --test=lib diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 7688a63..7098aa9 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -13,7 +13,7 @@ documentation = "https://docs.rs/data-encoding" description = "Efficient and customizable data-encoding functions like base64, base32, and hex" include = ["Cargo.toml", "LICENSE", "README.md", "src/lib.rs"] -# TODO: Remove this once doc_auto_cfg is in the MSRV. +# TODO: Remove this (and its lib and xtask counterpart) once doc_cfg is in the MSRV. [package.metadata.docs.rs] rustdoc-args = ["--cfg=docsrs"] diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 01a223f..67269aa 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -146,6 +146,9 @@ impl Action { &[&["--no-default-features", "--features=alloc"], &["--no-default-features"]]; } } + if self.dir == Dir::Lib && self.task == Task::Doc { + instructions.0[0].env[0].1.push_str(" --cfg=docsrs"); + } if self.dir == Dir::Nostd && self.task == Task::Test { instructions = Instructions::default(); instructions += Instruction { From ccf2c88dfe41dd9c159cc52cab511b37d7dcff29 Mon Sep 17 00:00:00 2001 From: Julien Cretin Date: Thu, 8 Jan 2026 09:42:10 +0100 Subject: [PATCH 3/3] changelog --- lib/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/CHANGELOG.md b/lib/CHANGELOG.md index f8a02ac..b973d69 100644 --- a/lib/CHANGELOG.md +++ b/lib/CHANGELOG.md @@ -7,6 +7,10 @@ - Document maximum input length for `Encoding::{decode,encode}_len()` (fixes #145) - Add `Encoding::encode_align()` to decide where to split long inputs +### Patch + +- Use `doc_cfg` instead of `doc_auto_cfg` + ## 2.9.0 ### Minor