Closed
Description
I tried this code:
#![cfg_attr(
any(),
feature(extended_key_value_attributes),
doc = include_str!("../README.md")
)]
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_attributes
is 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)