The following code:
// src/lib.rs
#![feature(doc_cfg)]
#[doc(cfg(any(target_os = "linux", target_os = "cygwin")))]
pub fn my_function() {}
is rendered by rustdoc like this:
I expected the cygwin requirement to be rendered along the lines of "Available on Cygwin only", but it is displayed as target_os="cygwin" instead which stands out unnecessarily.
I included a Linux requirement in the example for comparison. The issue happens without the any(target_os = "linux", _) part.
Version
$ rustdoc +nightly --version
rustdoc 1.90.0-nightly (ba7e63b63 2025-07-29)
The following code:
is rendered by rustdoc like this:
I expected the cygwin requirement to be rendered along the lines of "Available on Cygwin only", but it is displayed as
target_os="cygwin"instead which stands out unnecessarily.I included a Linux requirement in the example for comparison. The issue happens without the
any(target_os = "linux", _)part.Version