Skip to content

Commit 9ea82d5

Browse files
committed
clippy: BindingAnnotation change
1 parent ac4bb00 commit 9ea82d5

35 files changed

+95
-103
lines changed

src/tools/clippy/clippy_lints/src/dereference.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ impl<'tcx> LateLintPass<'tcx> for Dereferencing {
503503
}
504504

505505
fn check_pat(&mut self, cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>) {
506-
if let PatKind::Binding(BindingAnnotation::Ref, id, name, _) = pat.kind {
506+
if let PatKind::Binding(BindingAnnotation::REF, id, name, _) = pat.kind {
507507
if let Some(opt_prev_pat) = self.ref_locals.get_mut(&id) {
508508
// This binding id has been seen before. Add this pattern to the list of changes.
509509
if let Some(prev_pat) = opt_prev_pat {

src/tools/clippy/clippy_lints/src/explicit_write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn look_in_block<'tcx, 'hir>(cx: &LateContext<'tcx>, kind: &'tcx ExprKind<'hir>)
128128
if let Some(Node::Pat(res_pat)) = cx.tcx.hir().find(expr_res);
129129

130130
// Find id of the local we found in the block
131-
if let PatKind::Binding(BindingAnnotation::Unannotated, local_hir_id, _ident, None) = local.pat.kind;
131+
if let PatKind::Binding(BindingAnnotation::NONE, local_hir_id, _ident, None) = local.pat.kind;
132132

133133
// If those two are the same hir id
134134
if res_pat.hir_id == local_hir_id;

src/tools/clippy/clippy_lints/src/index_refutable_slice.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,14 @@ fn find_slice_values(cx: &LateContext<'_>, pat: &hir::Pat<'_>) -> FxIndexMap<hir
9595
let mut removed_pat: FxHashSet<hir::HirId> = FxHashSet::default();
9696
let mut slices: FxIndexMap<hir::HirId, SliceLintInformation> = FxIndexMap::default();
9797
pat.walk_always(|pat| {
98-
if let hir::PatKind::Binding(binding, value_hir_id, ident, sub_pat) = pat.kind {
99-
// We'll just ignore mut and ref mut for simplicity sake right now
100-
if let hir::BindingAnnotation::Mutable | hir::BindingAnnotation::RefMut = binding {
101-
return;
102-
}
103-
98+
// We'll just ignore mut and ref mut for simplicity sake right now
99+
if let hir::PatKind::Binding(
100+
hir::BindingAnnotation(by_ref, hir::Mutability::Not),
101+
value_hir_id,
102+
ident,
103+
sub_pat,
104+
) = pat.kind
105+
{
104106
// This block catches bindings with sub patterns. It would be hard to build a correct suggestion
105107
// for them and it's likely that the user knows what they are doing in such a case.
106108
if removed_pat.contains(&value_hir_id) {
@@ -116,7 +118,7 @@ fn find_slice_values(cx: &LateContext<'_>, pat: &hir::Pat<'_>) -> FxIndexMap<hir
116118
if let ty::Slice(inner_ty) | ty::Array(inner_ty, _) = bound_ty.peel_refs().kind() {
117119
// The values need to use the `ref` keyword if they can't be copied.
118120
// This will need to be adjusted if the lint want to support mutable access in the future
119-
let src_is_ref = bound_ty.is_ref() && binding != hir::BindingAnnotation::Ref;
121+
let src_is_ref = bound_ty.is_ref() && by_ref != hir::ByRef::Yes;
120122
let needs_ref = !(src_is_ref || is_copy(cx, *inner_ty));
121123

122124
let slice_info = slices

src/tools/clippy/clippy_lints/src/let_if_seq.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use clippy_utils::{path_to_local_id, visitors::is_local_used};
44
use if_chain::if_chain;
55
use rustc_errors::Applicability;
66
use rustc_hir as hir;
7-
use rustc_hir::BindingAnnotation;
7+
use rustc_hir::{BindingAnnotation, Mutability};
88
use rustc_lint::{LateContext, LateLintPass};
99
use rustc_session::{declare_lint_pass, declare_tool_lint};
1010

@@ -98,7 +98,7 @@ impl<'tcx> LateLintPass<'tcx> for LetIfSeq {
9898
};
9999

100100
let mutability = match mode {
101-
BindingAnnotation::RefMut | BindingAnnotation::Mutable => "<mut> ",
101+
BindingAnnotation(_, Mutability::Mut) => "<mut> ",
102102
_ => "",
103103
};
104104

src/tools/clippy/clippy_lints/src/loops/manual_find.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ fn get_binding(pat: &Pat<'_>) -> Option<HirId> {
106106
hir_id = None;
107107
return;
108108
}
109-
if let BindingAnnotation::Unannotated = annotation {
109+
if let BindingAnnotation::NONE = annotation {
110110
hir_id = Some(id);
111111
}
112112
});

src/tools/clippy/clippy_lints/src/loops/mut_range_bound.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn check_for_mutability(cx: &LateContext<'_>, bound: &Expr<'_>) -> Option<HirId>
4444
if_chain! {
4545
if let Some(hir_id) = path_to_local(bound);
4646
if let Node::Pat(pat) = cx.tcx.hir().get(hir_id);
47-
if let PatKind::Binding(BindingAnnotation::Mutable, ..) = pat.kind;
47+
if let PatKind::Binding(BindingAnnotation::MUT, ..) = pat.kind;
4848
then {
4949
return Some(hir_id);
5050
}

src/tools/clippy/clippy_lints/src/loops/same_item_push.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use if_chain::if_chain;
77
use rustc_data_structures::fx::FxHashSet;
88
use rustc_hir::def::{DefKind, Res};
99
use rustc_hir::intravisit::{walk_expr, Visitor};
10-
use rustc_hir::{BindingAnnotation, Block, Expr, ExprKind, HirId, Node, Pat, PatKind, Stmt, StmtKind};
10+
use rustc_hir::{BindingAnnotation, Block, Expr, ExprKind, HirId, Mutability, Node, Pat, PatKind, Stmt, StmtKind};
1111
use rustc_lint::LateContext;
1212
use rustc_span::symbol::sym;
1313
use std::iter::Iterator;
@@ -65,7 +65,7 @@ pub(super) fn check<'tcx>(
6565
if_chain! {
6666
if let Node::Pat(pat) = node;
6767
if let PatKind::Binding(bind_ann, ..) = pat.kind;
68-
if !matches!(bind_ann, BindingAnnotation::RefMut | BindingAnnotation::Mutable);
68+
if !matches!(bind_ann, BindingAnnotation(_, Mutability::Mut));
6969
let parent_node = cx.tcx.hir().get_parent_node(hir_id);
7070
if let Some(Node::Local(parent_let_expr)) = cx.tcx.hir().find(parent_node);
7171
if let Some(init) = parent_let_expr.init;

src/tools/clippy/clippy_lints/src/matches/manual_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ fn check<'tcx>(
165165
}
166166

167167
// `ref` and `ref mut` annotations were handled earlier.
168-
let annotation = if matches!(annotation, BindingAnnotation::Mutable) {
168+
let annotation = if matches!(annotation, BindingAnnotation::MUT) {
169169
"mut "
170170
} else {
171171
""

src/tools/clippy/clippy_lints/src/matches/match_as_ref.rs

+9-11
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,25 @@ use clippy_utils::diagnostics::span_lint_and_sugg;
22
use clippy_utils::source::snippet_with_applicability;
33
use clippy_utils::{is_lang_ctor, peel_blocks};
44
use rustc_errors::Applicability;
5-
use rustc_hir::{Arm, BindingAnnotation, Expr, ExprKind, LangItem, PatKind, QPath};
5+
use rustc_hir::{Arm, BindingAnnotation, ByRef, Expr, ExprKind, LangItem, Mutability, PatKind, QPath};
66
use rustc_lint::LateContext;
77
use rustc_middle::ty;
88

99
use super::MATCH_AS_REF;
1010

1111
pub(crate) fn check(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>], expr: &Expr<'_>) {
1212
if arms.len() == 2 && arms[0].guard.is_none() && arms[1].guard.is_none() {
13-
let arm_ref: Option<BindingAnnotation> = if is_none_arm(cx, &arms[0]) {
13+
let arm_ref_mut = if is_none_arm(cx, &arms[0]) {
1414
is_ref_some_arm(cx, &arms[1])
1515
} else if is_none_arm(cx, &arms[1]) {
1616
is_ref_some_arm(cx, &arms[0])
1717
} else {
1818
None
1919
};
20-
if let Some(rb) = arm_ref {
21-
let suggestion = if rb == BindingAnnotation::Ref {
22-
"as_ref"
23-
} else {
24-
"as_mut"
20+
if let Some(rb) = arm_ref_mut {
21+
let suggestion = match rb {
22+
Mutability::Not => "as_ref",
23+
Mutability::Mut => "as_mut",
2524
};
2625

2726
let output_ty = cx.typeck_results().expr_ty(expr);
@@ -66,19 +65,18 @@ fn is_none_arm(cx: &LateContext<'_>, arm: &Arm<'_>) -> bool {
6665
}
6766

6867
// Checks if arm has the form `Some(ref v) => Some(v)` (checks for `ref` and `ref mut`)
69-
fn is_ref_some_arm(cx: &LateContext<'_>, arm: &Arm<'_>) -> Option<BindingAnnotation> {
68+
fn is_ref_some_arm(cx: &LateContext<'_>, arm: &Arm<'_>) -> Option<Mutability> {
7069
if_chain! {
7170
if let PatKind::TupleStruct(ref qpath, [first_pat, ..], _) = arm.pat.kind;
7271
if is_lang_ctor(cx, qpath, LangItem::OptionSome);
73-
if let PatKind::Binding(rb, .., ident, _) = first_pat.kind;
74-
if rb == BindingAnnotation::Ref || rb == BindingAnnotation::RefMut;
72+
if let PatKind::Binding(BindingAnnotation(ByRef::Yes, mutabl), .., ident, _) = first_pat.kind;
7573
if let ExprKind::Call(e, [arg]) = peel_blocks(arm.body).kind;
7674
if let ExprKind::Path(ref some_path) = e.kind;
7775
if is_lang_ctor(cx, some_path, LangItem::OptionSome);
7876
if let ExprKind::Path(QPath::Resolved(_, path2)) = arg.kind;
7977
if path2.segments.len() == 1 && ident.name == path2.segments[0].ident.name;
8078
then {
81-
return Some(rb)
79+
return Some(mutabl)
8280
}
8381
}
8482
None

src/tools/clippy/clippy_lints/src/matches/needless_match.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use clippy_utils::{
88
};
99
use rustc_errors::Applicability;
1010
use rustc_hir::LangItem::OptionNone;
11-
use rustc_hir::{Arm, BindingAnnotation, Expr, ExprKind, FnRetTy, Guard, Node, Pat, PatKind, Path, QPath};
11+
use rustc_hir::{Arm, BindingAnnotation, ByRef, Expr, ExprKind, FnRetTy, Guard, Node, Pat, PatKind, Path, QPath};
1212
use rustc_lint::LateContext;
1313
use rustc_span::sym;
1414
use rustc_typeck::hir_ty_to_ty;
@@ -189,8 +189,7 @@ fn pat_same_as_expr(pat: &Pat<'_>, expr: &Expr<'_>) -> bool {
189189
},
190190
)),
191191
) => {
192-
return !matches!(annot, BindingAnnotation::Ref | BindingAnnotation::RefMut)
193-
&& pat_ident.name == first_seg.ident.name;
192+
return !matches!(annot, BindingAnnotation(ByRef::Yes, _)) && pat_ident.name == first_seg.ident.name;
194193
},
195194
// Example: `Custom::TypeA => Custom::TypeB`, or `None => None`
196195
(PatKind::Path(QPath::Resolved(_, p_path)), ExprKind::Path(QPath::Resolved(_, e_path))) => {

src/tools/clippy/clippy_lints/src/matches/single_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ fn collect_pat_paths<'a>(acc: &mut Vec<Ty<'a>>, cx: &LateContext<'a>, pat: &Pat<
175175
let p_ty = cx.typeck_results().pat_ty(p);
176176
collect_pat_paths(acc, cx, p, p_ty);
177177
}),
178-
PatKind::TupleStruct(..) | PatKind::Binding(BindingAnnotation::Unannotated, .., None) | PatKind::Path(_) => {
178+
PatKind::TupleStruct(..) | PatKind::Binding(BindingAnnotation::NONE, .., None) | PatKind::Path(_) => {
179179
acc.push(ty);
180180
},
181181
_ => {},

src/tools/clippy/clippy_lints/src/methods/clone_on_copy.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use clippy_utils::source::snippet_with_context;
44
use clippy_utils::sugg;
55
use clippy_utils::ty::is_copy;
66
use rustc_errors::Applicability;
7-
use rustc_hir::{BindingAnnotation, Expr, ExprKind, MatchSource, Node, PatKind, QPath};
7+
use rustc_hir::{BindingAnnotation, ByRef, Expr, ExprKind, MatchSource, Node, PatKind, QPath};
88
use rustc_lint::LateContext;
99
use rustc_middle::ty::{self, adjustment::Adjust};
1010
use rustc_span::symbol::{sym, Symbol};
@@ -98,12 +98,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, method_name: Symbol,
9898
_ => false,
9999
},
100100
// local binding capturing a reference
101-
Some(Node::Local(l))
102-
if matches!(
103-
l.pat.kind,
104-
PatKind::Binding(BindingAnnotation::Ref | BindingAnnotation::RefMut, ..)
105-
) =>
106-
{
101+
Some(Node::Local(l)) if matches!(l.pat.kind, PatKind::Binding(BindingAnnotation(ByRef::Yes, _), ..)) => {
107102
return;
108103
},
109104
_ => false,

src/tools/clippy/clippy_lints/src/methods/iter_skip_next.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &hir::Expr<'_>, recv: &hir::Expr
2424
if let Some(id) = path_to_local(recv);
2525
if let Node::Pat(pat) = cx.tcx.hir().get(id);
2626
if let PatKind::Binding(ann, _, _, _) = pat.kind;
27-
if ann != BindingAnnotation::Mutable;
27+
if ann != BindingAnnotation::MUT;
2828
then {
2929
application = Applicability::Unspecified;
3030
diag.span_help(

src/tools/clippy/clippy_lints/src/methods/map_clone.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ pub(super) fn check<'tcx>(
3333
let closure_expr = peel_blocks(&closure_body.value);
3434
match closure_body.params[0].pat.kind {
3535
hir::PatKind::Ref(inner, hir::Mutability::Not) => if let hir::PatKind::Binding(
36-
hir::BindingAnnotation::Unannotated, .., name, None
36+
hir::BindingAnnotation::NONE, .., name, None
3737
) = inner.kind {
3838
if ident_eq(name, closure_expr) {
3939
lint_explicit_closure(cx, e.span, recv.span, true, msrv);
4040
}
4141
},
42-
hir::PatKind::Binding(hir::BindingAnnotation::Unannotated, .., name, None) => {
42+
hir::PatKind::Binding(hir::BindingAnnotation::NONE, .., name, None) => {
4343
match closure_expr.kind {
4444
hir::ExprKind::Unary(hir::UnOp::Deref, inner) => {
4545
if ident_eq(name, inner) {

src/tools/clippy/clippy_lints/src/methods/str_splitn.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fn check_manual_split_once_indirect(
130130
let ctxt = expr.span.ctxt();
131131
let mut parents = cx.tcx.hir().parent_iter(expr.hir_id);
132132
if let (_, Node::Local(local)) = parents.next()?
133-
&& let PatKind::Binding(BindingAnnotation::Mutable, iter_binding_id, iter_ident, None) = local.pat.kind
133+
&& let PatKind::Binding(BindingAnnotation::MUT, iter_binding_id, iter_ident, None) = local.pat.kind
134134
&& let (iter_stmt_id, Node::Stmt(_)) = parents.next()?
135135
&& let (_, Node::Block(enclosing_block)) = parents.next()?
136136

@@ -212,11 +212,10 @@ fn indirect_usage<'tcx>(
212212
ctxt: SyntaxContext,
213213
) -> Option<IndirectUsage<'tcx>> {
214214
if let StmtKind::Local(Local {
215-
pat:
216-
Pat {
217-
kind: PatKind::Binding(BindingAnnotation::Unannotated, _, ident, None),
218-
..
219-
},
215+
pat: Pat {
216+
kind: PatKind::Binding(BindingAnnotation::NONE, _, ident, None),
217+
..
218+
},
220219
init: Some(init_expr),
221220
hir_id: local_hir_id,
222221
..

src/tools/clippy/clippy_lints/src/misc.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use rustc_ast::ast::LitKind;
55
use rustc_errors::Applicability;
66
use rustc_hir::intravisit::FnKind;
77
use rustc_hir::{
8-
self as hir, def, BinOpKind, BindingAnnotation, Body, Expr, ExprKind, FnDecl, HirId, Mutability, PatKind, Stmt,
9-
StmtKind, TyKind,
8+
self as hir, def, BinOpKind, BindingAnnotation, Body, ByRef, Expr, ExprKind, FnDecl, HirId, Mutability, PatKind,
9+
Stmt, StmtKind, TyKind,
1010
};
1111
use rustc_lint::{LateContext, LateLintPass};
1212
use rustc_middle::lint::in_external_macro;
@@ -146,7 +146,7 @@ impl<'tcx> LateLintPass<'tcx> for MiscLints {
146146
return;
147147
}
148148
for arg in iter_input_pats(decl, body) {
149-
if let PatKind::Binding(BindingAnnotation::Ref | BindingAnnotation::RefMut, ..) = arg.pat.kind {
149+
if let PatKind::Binding(BindingAnnotation(ByRef::Yes, _), ..) = arg.pat.kind {
150150
span_lint(
151151
cx,
152152
TOPLEVEL_REF_ARG,
@@ -162,9 +162,8 @@ impl<'tcx> LateLintPass<'tcx> for MiscLints {
162162
if_chain! {
163163
if !in_external_macro(cx.tcx.sess, stmt.span);
164164
if let StmtKind::Local(local) = stmt.kind;
165-
if let PatKind::Binding(an, .., name, None) = local.pat.kind;
165+
if let PatKind::Binding(BindingAnnotation(ByRef::Yes, mutabl), .., name, None) = local.pat.kind;
166166
if let Some(init) = local.init;
167-
if an == BindingAnnotation::Ref || an == BindingAnnotation::RefMut;
168167
then {
169168
// use the macro callsite when the init span (but not the whole local span)
170169
// comes from an expansion like `vec![1, 2, 3]` in `let ref _ = vec![1, 2, 3];`
@@ -173,7 +172,7 @@ impl<'tcx> LateLintPass<'tcx> for MiscLints {
173172
} else {
174173
Sugg::hir(cx, init, "..")
175174
};
176-
let (mutopt, initref) = if an == BindingAnnotation::RefMut {
175+
let (mutopt, initref) = if mutabl == Mutability::Mut {
177176
("mut ", sugg_init.mut_addr())
178177
} else {
179178
("", sugg_init.addr())

src/tools/clippy/clippy_lints/src/misc_early/redundant_pattern.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
use clippy_utils::diagnostics::span_lint_and_sugg;
2-
use rustc_ast::ast::{BindingMode, Mutability, Pat, PatKind};
2+
use rustc_ast::ast::{Pat, PatKind};
33
use rustc_errors::Applicability;
44
use rustc_lint::EarlyContext;
55

66
use super::REDUNDANT_PATTERN;
77

88
pub(super) fn check(cx: &EarlyContext<'_>, pat: &Pat) {
9-
if let PatKind::Ident(left, ident, Some(ref right)) = pat.kind {
10-
let left_binding = match left {
11-
BindingMode::ByRef(Mutability::Mut) => "ref mut ",
12-
BindingMode::ByRef(Mutability::Not) => "ref ",
13-
BindingMode::ByValue(..) => "",
14-
};
15-
9+
if let PatKind::Ident(ann, ident, Some(ref right)) = pat.kind {
1610
if let PatKind::Wild = right.kind {
1711
span_lint_and_sugg(
1812
cx,
@@ -23,7 +17,7 @@ pub(super) fn check(cx: &EarlyContext<'_>, pat: &Pat) {
2317
ident.name, ident.name,
2418
),
2519
"try",
26-
format!("{}{}", left_binding, ident.name),
20+
format!("{}{}", ann.prefix_str(), ident.name),
2721
Applicability::MachineApplicable,
2822
);
2923
}

src/tools/clippy/clippy_lints/src/needless_arbitrary_self_type.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clippy_utils::diagnostics::span_lint_and_sugg;
22
use if_chain::if_chain;
3-
use rustc_ast::ast::{BindingMode, Lifetime, Mutability, Param, PatKind, Path, TyKind};
3+
use rustc_ast::ast::{BindingAnnotation, ByRef, Lifetime, Mutability, Param, PatKind, Path, TyKind};
44
use rustc_errors::Applicability;
55
use rustc_lint::{EarlyContext, EarlyLintPass};
66
use rustc_session::{declare_lint_pass, declare_tool_lint};
@@ -120,14 +120,14 @@ impl EarlyLintPass for NeedlessArbitrarySelfType {
120120

121121
match &p.ty.kind {
122122
TyKind::Path(None, path) => {
123-
if let PatKind::Ident(BindingMode::ByValue(mutbl), _, _) = p.pat.kind {
123+
if let PatKind::Ident(BindingAnnotation(ByRef::No, mutbl), _, _) = p.pat.kind {
124124
check_param_inner(cx, path, p.span.to(p.ty.span), &Mode::Value, mutbl);
125125
}
126126
},
127127
TyKind::Rptr(lifetime, mut_ty) => {
128128
if_chain! {
129129
if let TyKind::Path(None, path) = &mut_ty.ty.kind;
130-
if let PatKind::Ident(BindingMode::ByValue(Mutability::Not), _, _) = p.pat.kind;
130+
if let PatKind::Ident(BindingAnnotation::NONE, _, _) = p.pat.kind;
131131
then {
132132
check_param_inner(cx, path, p.span.to(p.ty.span), &Mode::Ref(*lifetime), mut_ty.mutbl);
133133
}

src/tools/clippy/clippy_lints/src/needless_borrowed_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessBorrowedRef {
5959
if let PatKind::Ref(sub_pat, Mutability::Not) = pat.kind;
6060

6161
// Check sub_pat got a `ref` keyword (excluding `ref mut`).
62-
if let PatKind::Binding(BindingAnnotation::Ref, .., spanned_name, _) = sub_pat.kind;
62+
if let PatKind::Binding(BindingAnnotation::REF, .., spanned_name, _) = sub_pat.kind;
6363
let parent_id = cx.tcx.hir().get_parent_node(pat.hir_id);
6464
if let Some(parent_node) = cx.tcx.hir().find(parent_id);
6565
then {

src/tools/clippy/clippy_lints/src/needless_late_init.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessLateInit {
373373
if let Local {
374374
init: None,
375375
pat: &Pat {
376-
kind: PatKind::Binding(BindingAnnotation::Unannotated, binding_id, _, None),
376+
kind: PatKind::Binding(BindingAnnotation::NONE, binding_id, _, None),
377377
..
378378
},
379379
source: LocalSource::Normal,

0 commit comments

Comments
 (0)