1
Fork 0

rust-analyzer guided tuple field to named field

This commit is contained in:
Oli Scherer 2023-03-29 08:50:04 +00:00
parent b08a557f80
commit e3828777a6
16 changed files with 33 additions and 24 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(ast::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(ast::Static(ty, ..)) = &item.kind
&& let ItemKind::Static(ast::Static { ty, ..}) = &item.kind
{
(item, true, ecx.with_def_site_ctxt(ty.span))
} else {