diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c933d86..6745757 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,3 +103,26 @@ jobs: - name: cargo doc --no-deps --all-features run: cargo doc --no-deps --all-features + + docsrs: + name: Docs build (docs.rs config) + runs-on: ubuntu-latest + env: + # Mirror the docs.rs build environment so a docs.rs-only failure is + # caught here rather than only after publishing. docs.rs builds on + # nightly and passes `--cfg docsrs` (see [package.metadata.docs.rs] in + # Cargo.toml); the plain `docs` job above runs on stable without + # `--cfg docsrs`, so the `#[cfg_attr(docsrs, doc(cfg(...)))]` labels are + # inert there and a missing crate-root `feature(doc_cfg)` slips through. + RUSTDOCFLAGS: --cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links + steps: + - uses: actions/checkout@v6 + + - name: Install Rust (nightly, as docs.rs uses) + uses: dtolnay/rust-toolchain@nightly + + - name: Cache + uses: Swatinem/rust-cache@v2 + + - name: cargo doc --no-deps --all-features (docs.rs config) + run: cargo doc --no-deps --all-features diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b3468b..e6f10a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- **docs.rs build**: add the crate-root `#![cfg_attr(docsrs, feature(doc_cfg))]` + that the crate's per-module `#[cfg_attr(docsrs, doc(cfg(...)))]` labels + require. Without it the docs.rs build (nightly + `--cfg docsrs`) failed with + E0658, even though the plain stable `cargo doc` CI job — where `docsrs` is + unset and the attributes are inert — passed. A new CI job (`docsrs`) now + builds the docs the way docs.rs does (nightly + `--cfg docsrs`, warnings + denied) so this gap is caught before publishing. + +### Fixed + - *(cli)* `compcol -d` no longer truncates highly-compressible large inputs. The streaming decode loop stopped once the compressed input was consumed, leaving output a block-buffering decoder (notably bzip2) still held diff --git a/src/lib.rs b/src/lib.rs index 1b986af..8c3aa0c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,6 +11,15 @@ #![no_std] #![forbid(unsafe_code)] +// Enable the nightly `doc_cfg` feature when building the docs.rs doc set +// (docs.rs passes `--cfg docsrs`). Modules across the crate carry +// `#![cfg_attr(docsrs, doc(cfg(feature = "...")))]` to label which feature +// each item needs; those `#[doc(cfg(...))]` attributes are experimental and +// require this crate-level `feature(doc_cfg)`. Without it, the docs.rs build +// (nightly + `--cfg docsrs`) fails with E0658 even though a plain stable +// `cargo doc` — where `docsrs` is unset and the attributes are inert — +// succeeds. Gated on `docsrs` so stable builds never see the nightly feature. +#![cfg_attr(docsrs, feature(doc_cfg))] #[cfg(feature = "alloc")] extern crate alloc;