Skip to content

Comments

docs: fix build with unstable features#849

Merged
yara-blue merged 1 commit intoRustAudio:masterfrom
aschey:docs/fix-build
Feb 22, 2026
Merged

docs: fix build with unstable features#849
yara-blue merged 1 commit intoRustAudio:masterfrom
aschey:docs/fix-build

Conversation

@aschey
Copy link
Contributor

@aschey aschey commented Feb 21, 2026

The docs failed to build for 0.22.0 because #[doc(cfg)] is experimental (see build logs here).

[INFO] [stderr] error[E0658]: `#[doc(cfg)]` is experimental
[INFO] [stderr]    --> src/lib.rs:187:20
[INFO] [stderr]     |
[INFO] [stderr] 187 | #[cfg_attr(docsrs, doc(cfg(feature = "wav_output")))]

We can fix this by passing cargo-args = ["-Zunstable-options"]

Additionally, we can use #![cfg_attr(docsrs, feature(doc_cfg))] to automatically document features without having to add #[cfg_attr(docsrs, doc(cfg(feature = "feature_name")))] everywhere.

We can verify this works by running RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc -Zunstable-options --all-features --no-deps --open and checking the output:

image

@yara-blue
Copy link
Member

docs failed to build for 0.22.0

O.o. 💥
We clearly need that tested in CI. I'll merge this ASAP and put up a new release. Just in case you're a github CI magician could you add a step to CI checking if the docs build?

@yara-blue yara-blue merged commit f52478c into RustAudio:master Feb 22, 2026
3 checks passed
@aschey aschey deleted the docs/fix-build branch February 22, 2026 00:45
@yara-blue
Copy link
Member

yara-blue commented Feb 22, 2026

oh and thanks so much for not only reporting but coming up with a fix! 🎉

Especially with something as time sensitive as this 😅

@aschey
Copy link
Contributor Author

aschey commented Feb 22, 2026

No problem! Here's a follow-up PR to verify docs in CI: #850

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants