Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Urgau opened this issue Mar 6, 2025 · 0 comments · Fixed by #141747
Closed

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

Urgau opened this issue Mar 6, 2025 · 0 comments · Fixed by #141747
Assignees
Labels
C-bug Category: This is a bug. F-doc_cfg `#![feature(doc_cfg)]` T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Urgau
Copy link
Member

Urgau commented Mar 6, 2025

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
@Urgau Urgau added C-bug Category: This is a bug. F-doc_cfg `#![feature(doc_cfg)]` T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 6, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 6, 2025
@GuillaumeGomez GuillaumeGomez removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 6, 2025
@lolbinarycat lolbinarycat self-assigned this May 29, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue May 30, 2025
…=GuillaumeGomez

rustdoc: display doc(cfg(false)) properly

before we had an extra 'on' that was
ungramatical.

fixes rust-lang#138112

this is what it looks like now:
![screenshot: Available nowhere](https://github.com/user-attachments/assets/e27b4990-09a7-4f13-8bcf-26d44c8c1bea)
@bors bors closed this as completed in c6eb1d9 May 30, 2025
rust-timer added a commit that referenced this issue May 30, 2025
Rollup merge of #141747 - lolbinarycat:rustdoc-cfg-138112, r=GuillaumeGomez

rustdoc: display doc(cfg(false)) properly

before we had an extra 'on' that was
ungramatical.

fixes #138112

this is what it looks like now:
![screenshot: Available nowhere](https://github.com/user-attachments/assets/e27b4990-09a7-4f13-8bcf-26d44c8c1bea)
github-actions bot pushed a commit to rust-lang/miri that referenced this issue May 31, 2025
…eGomez

rustdoc: display doc(cfg(false)) properly

before we had an extra 'on' that was
ungramatical.

fixes rust-lang/rust#138112

this is what it looks like now:
![screenshot: Available nowhere](https://github.com/user-attachments/assets/e27b4990-09a7-4f13-8bcf-26d44c8c1bea)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-doc_cfg `#![feature(doc_cfg)]` T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants