Skip to content

rustdoc with doc(cfg(false)) prints an extra "on" #138112

Closed
@Urgau

Description

@Urgau

I tried this code:

#![feature(doc_cfg)]

#[doc(cfg(false))]
pub fn foo() {}

I expected to see this happen: Avalaible nowhere (without the on)

Instead, this happened:

Image

Meta

rustdoc --version --verbose:

rustdoc 1.87.0-nightly (e16a049ad 2025-03-03)
binary: rustdoc
commit-hash: e16a049adbf94d610787430b6efdf31d896dc5b6
commit-date: 2025-03-03
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.F-doc_cfg`#![feature(doc_cfg)]`T-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