Fix parsing of active cfg_attr
This commit is contained in:
parent
08de1b4fa5
commit
d42d1d33f0
1 changed files with 2 additions and 2 deletions
|
@ -167,6 +167,7 @@ impl RawAttrs {
|
|||
});
|
||||
cfg.pop(); // `,` ends up in here
|
||||
|
||||
let attr = Subtree { delimiter: None, token_trees: attr };
|
||||
let cfg = Subtree { delimiter: subtree.delimiter, token_trees: cfg };
|
||||
let cfg = CfgExpr::parse(&cfg);
|
||||
|
||||
|
@ -174,8 +175,7 @@ impl RawAttrs {
|
|||
if cfg_options.check(&cfg) == Some(false) {
|
||||
None
|
||||
} else {
|
||||
let attr = Subtree { delimiter: None, token_trees: attr };
|
||||
let attr = ast::Attr::parse(&attr.to_string()).ok()?;
|
||||
let attr = ast::Attr::parse(&format!("#[{}]", attr)).ok()?;
|
||||
let hygiene = Hygiene::new_unhygienic(); // FIXME
|
||||
Attr::from_src(attr, &hygiene)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue