Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading