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).
This commit is contained in:
Florian Diebold 2021-07-11 13:22:11 +02:00
parent 87621de2b9
commit b7bd45574a

View File

@ -448,7 +448,12 @@ impl<'a> Ctx<'a> {
}
fn lower_const(&mut self, konst: &ast::Const) -> FileItemTreeId<Const> {
let name = konst.name().map(|it| it.as_name());
let mut name = konst.name().map(|it| it.as_name());
if name.as_ref().map_or(false, |n| n.to_string().starts_with("_DERIVE_")) {
// FIXME: this is a hack to treat consts generated by synstructure as unnamed
// remove this some time in the future
name = None;
}
let type_ref = self.lower_type_ref_opt(konst.ty());
let visibility = self.lower_visibility(konst);
let ast_id = self.source_ast_id_map.ast_id(konst);