-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Rustdoc and rustc accept different cfg syntax #84437
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-doc_cfg`#![feature(doc_cfg)]``#![feature(doc_cfg)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-doc_cfg`#![feature(doc_cfg)]``#![feature(doc_cfg)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
I expected to see this happen: An error, to match the behavior on
#[cfg(x, y)]:Instead, this happened: Rustdoc silently accepts the code.
Relevant code:
rust/src/librustdoc/clean/cfg.rs
Line 62 in 88b99de
I think the relevant rustc code is
rust/compiler/rustc_expand/src/config.rs
Line 455 in 88b99de
Meta
rustdoc --version: rustdoc 1.53.0-nightly (392ba2b 2021-04-17)