rust-analyzer guided tuple field to named field

This commit is contained in:
Oli Scherer 2023-03-29 08:50:04 +00:00
parent a6beddcc5a
commit 929696d754
2 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ impl EarlyLintPass for RedundantStaticLifetimes {
// #2438) // #2438)
} }
if let ItemKind::Static(Static(ref var_type, _, _)) = item.kind { if let ItemKind::Static(Static{ ty: ref var_type,.. }) = item.kind {
Self::visit_type(var_type, cx, "statics have by default a `'static` lifetime"); Self::visit_type(var_type, cx, "statics have by default a `'static` lifetime");
} }
} }

View File

@ -286,7 +286,7 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
match (l, r) { match (l, r) {
(ExternCrate(l), ExternCrate(r)) => l == r, (ExternCrate(l), ExternCrate(r)) => l == r,
(Use(l), Use(r)) => eq_use_tree(l, r), (Use(l), Use(r)) => eq_use_tree(l, r),
(Static(ast::Static(lt, lm, le)), Static(ast::Static(rt, rm, re))) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le, re), (Static(ast::Static{ ty: lt, mutability: lm, expr: le}), Static(ast::Static { ty: rt, mutability: rm, expr: re})) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le, re),
(Const(ld, lt, le), Const(rd, rt, re)) => eq_defaultness(*ld, *rd) && eq_ty(lt, rt) && eq_expr_opt(le, re), (Const(ld, lt, le), Const(rd, rt, re)) => eq_defaultness(*ld, *rd) && eq_ty(lt, rt) && eq_expr_opt(le, re),
( (
Fn(box ast::Fn { Fn(box ast::Fn {