Extended key value attributes are parsed too eagerly #85882
Labels
C-bug
Category: This is a bug.
F-extended_key_value_attributes
`#![feature(extended_key_value_attributes)]
Consider the following rust code, I would have expected the below to compile on stable today when compiled with
rustc src/lib.rs
, but in fact it fails to compile citing that arbitrary key values are unstable. Which implies that theinclude_str!
parsing is being handled ahead of handling thecfg
predicate. While this specific example won't be an issue when this becomes stable in 1.54.0, but it does point to this feature having some surprising behaviour at the moment, I would have expected thecfg
predicate on the module to have been evaluated to false and the whole module would be skipped, regardless of what I used on the right hand side ofdoc
.There's a workaround if you're okay with double wrapping the modules, as if you embed it in a declarative macro, it will behave how you expect.
The text was updated successfully, but these errors were encountered: