Skip to content

Commit b7bd455

Browse files
committed
Add workaround for #9562
This treats the consts generated by older synstructure versions like unnamed consts. We should remove this at some point (at least after Chalk has switched).
1 parent 87621de commit b7bd455

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/hir_def/src/item_tree/lower.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,12 @@ impl<'a> Ctx<'a> {
448448
}
449449

450450
fn lower_const(&mut self, konst: &ast::Const) -> FileItemTreeId<Const> {
451-
let name = konst.name().map(|it| it.as_name());
451+
let mut name = konst.name().map(|it| it.as_name());
452+
if name.as_ref().map_or(false, |n| n.to_string().starts_with("_DERIVE_")) {
453+
// FIXME: this is a hack to treat consts generated by synstructure as unnamed
454+
// remove this some time in the future
455+
name = None;
456+
}
452457
let type_ref = self.lower_type_ref_opt(konst.ty());
453458
let visibility = self.lower_visibility(konst);
454459
let ast_id = self.source_ast_id_map.ast_id(konst);

0 commit comments

Comments
 (0)