aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/hir_def/src/attr.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs
index b8d9c2682..68d05c54d 100644
--- a/crates/hir_def/src/attr.rs
+++ b/crates/hir_def/src/attr.rs
@@ -167,6 +167,7 @@ impl RawAttrs {
167 }); 167 });
168 cfg.pop(); // `,` ends up in here 168 cfg.pop(); // `,` ends up in here
169 169
170 let attr = Subtree { delimiter: None, token_trees: attr };
170 let cfg = Subtree { delimiter: subtree.delimiter, token_trees: cfg }; 171 let cfg = Subtree { delimiter: subtree.delimiter, token_trees: cfg };
171 let cfg = CfgExpr::parse(&cfg); 172 let cfg = CfgExpr::parse(&cfg);
172 173
@@ -174,8 +175,7 @@ impl RawAttrs {
174 if cfg_options.check(&cfg) == Some(false) { 175 if cfg_options.check(&cfg) == Some(false) {
175 None 176 None
176 } else { 177 } else {
177 let attr = Subtree { delimiter: None, token_trees: attr }; 178 let attr = ast::Attr::parse(&format!("#[{}]", attr)).ok()?;
178 let attr = ast::Attr::parse(&attr.to_string()).ok()?;
179 let hygiene = Hygiene::new_unhygienic(); // FIXME 179 let hygiene = Hygiene::new_unhygienic(); // FIXME
180 Attr::from_src(attr, &hygiene) 180 Attr::from_src(attr, &hygiene)
181 } 181 }