-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
extended_key_value_attributes cannot be enabled conditionally #82768
Copy link
Copy link
Closed
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-stabilityArea: `#[stable]`, `#[unstable]` etc.Area: `#[stable]`, `#[unstable]` etc.F-extended_key_value_attributes`#![feature(extended_key_value_attributes)]`#![feature(extended_key_value_attributes)]T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-stabilityArea: `#[stable]`, `#[unstable]` etc.Area: `#[stable]`, `#[unstable]` etc.F-extended_key_value_attributes`#![feature(extended_key_value_attributes)]`#![feature(extended_key_value_attributes)]T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
I expected to see this happen: The compiler gives no error, because
doc = include_str!should only be compiled if the predicate is true.Instead, this happened: The compiler gives an error that
extended_key_value_attributesis unstable.I guess this happens because the compiler has to parse the attribute even if the cfg is false? @petrochenkov is giving an error here intentional?
Meta
rustc --version: 1.52.0-nightly (2021-03-01 4f20caa)cc #78835
Originally posted by @daxpedda in #82539 (comment)