Skip to content

The doc(cfg(target_os = "cygwin")) annotation is rendered poorly #144680

@Darksonn

Description

@Darksonn

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:

Image

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-cygwinTarget: *-pc-cygwinT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions