-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
rustdoc doesn't gate cfg(true/false)
within doc(cfg(..))
#138113
Comments
The current feature gating is done (for rust/compiler/rustc_attr_parsing/src/attributes/cfg.rs Lines 95 to 104 in 30f168e
|
And if rustdoc where to call |
…eGomez rustdoc: Gate unstable `doc(cfg())` predicates Fixes rust-lang#138113 Since the extraction process treats `cfg(true)` as having no cfg attribute, we have to do the gating during parsing; so we remove the unused `features` arg from `Cfg::matches`
…eGomez rustdoc: Gate unstable `doc(cfg())` predicates Fixes rust-lang#138113 Since the extraction process treats `cfg(true)` as having no cfg attribute, we have to do the gating during parsing; so we remove the unused `features` arg from `Cfg::matches`
…eGomez rustdoc: Gate unstable `doc(cfg())` predicates Fixes rust-lang#138113 Since the extraction process treats `cfg(true)` as having no cfg attribute, we have to do the gating during parsing; so we remove the unused `features` arg from `Cfg::matches`
Rollup merge of rust-lang#138293 - clubby789:doc-cfg-gate, r=GuillaumeGomez rustdoc: Gate unstable `doc(cfg())` predicates Fixes rust-lang#138113 Since the extraction process treats `cfg(true)` as having no cfg attribute, we have to do the gating during parsing; so we remove the unused `features` arg from `Cfg::matches`
I tried this code:
I expected to see this happen: An error requiring
#![feature(cfg_boolean_literals)]
, as is the case currently when done#[cfg(true)]
.Instead, this happened: The documenation is generated and no extra feature gate is required.
Meta
rustdoc --version --verbose
:The text was updated successfully, but these errors were encountered: