We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08de1b4 commit d42d1d3Copy full SHA for d42d1d3
crates/hir_def/src/attr.rs
@@ -167,15 +167,15 @@ impl RawAttrs {
167
});
168
cfg.pop(); // `,` ends up in here
169
170
+ let attr = Subtree { delimiter: None, token_trees: attr };
171
let cfg = Subtree { delimiter: subtree.delimiter, token_trees: cfg };
172
let cfg = CfgExpr::parse(&cfg);
173
174
let cfg_options = &crate_graph[krate].cfg_options;
175
if cfg_options.check(&cfg) == Some(false) {
176
None
177
} else {
- let attr = Subtree { delimiter: None, token_trees: attr };
178
- let attr = ast::Attr::parse(&attr.to_string()).ok()?;
+ let attr = ast::Attr::parse(&format!("#[{}]", attr)).ok()?;
179
let hygiene = Hygiene::new_unhygienic(); // FIXME
180
Attr::from_src(attr, &hygiene)
181
}
0 commit comments