1
Fork 0

rust-analyzer guided enum variant structification

This commit is contained in:
Oli Scherer 2023-03-29 08:37:47 +00:00
parent 35d06f9c74
commit b08a557f80
16 changed files with 36 additions and 25 deletions

View file

@ -25,12 +25,12 @@ pub fn expand(
// FIXME - if we get deref patterns, use them to reduce duplication here
let (item, is_stmt, ty_span) =
if let Annotatable::Item(item) = &item
&& let ItemKind::Static(ty, ..) = &item.kind
&& let ItemKind::Static(ast::Static(ty, ..)) = &item.kind
{
(item, false, ecx.with_def_site_ctxt(ty.span))
} else if let Annotatable::Stmt(stmt) = &item
&& let StmtKind::Item(item) = &stmt.kind
&& let ItemKind::Static(ty, ..) = &item.kind
&& let ItemKind::Static(ast::Static(ty, ..)) = &item.kind
{
(item, true, ecx.with_def_site_ctxt(ty.span))
} else {