Skip to content

Commit 43a61e9

Browse files
Rename hir::Node::Local into hir::Node::LetStmt
1 parent bd9efd5 commit 43a61e9

27 files changed

+40
-40
lines changed

clippy_lints/src/assigning_clones.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ fn is_ok_to_suggest<'tcx>(cx: &LateContext<'tcx>, lhs: &Expr<'tcx>, call: &CallC
163163
// TODO: This check currently bails if the local variable has no initializer.
164164
// That is overly conservative - the lint should fire even if there was no initializer,
165165
// but the variable has been initialized before `lhs` was evaluated.
166-
if let Some(Node::Local(local)) = cx.tcx.hir().parent_id_iter(local).next().map(|p| cx.tcx.hir_node(p))
166+
if let Some(Node::LetStmt(local)) = cx.tcx.hir().parent_id_iter(local).next().map(|p| cx.tcx.hir_node(p))
167167
&& local.init.is_none()
168168
{
169169
return false;

clippy_lints/src/box_default.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl<'tcx> Visitor<'tcx> for InferVisitor {
139139

140140
fn given_type(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
141141
match cx.tcx.parent_hir_node(expr.hir_id) {
142-
Node::Local(LetStmt { ty: Some(ty), .. }) => {
142+
Node::LetStmt(LetStmt { ty: Some(ty), .. }) => {
143143
let mut v = InferVisitor::default();
144144
v.visit_ty(ty);
145145
!v.0

clippy_lints/src/casts/ref_as_ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub(super) fn check<'tcx>(
2424
&& let ty::RawPtr(TypeAndMut { mutbl: to_mutbl, .. }) = cast_to.kind()
2525
&& let Some(use_cx) = expr_use_ctxt(cx, expr)
2626
// TODO: only block the lint if `cast_expr` is a temporary
27-
&& !matches!(use_cx.node, ExprUseNode::Local(_) | ExprUseNode::ConstStatic(_))
27+
&& !matches!(use_cx.node, ExprUseNode::LetStmt(_) | ExprUseNode::ConstStatic(_))
2828
{
2929
let core_or_std = if is_no_std_crate(cx) { "core" } else { "std" };
3030
let fn_name = match to_mutbl {

clippy_lints/src/casts/unnecessary_cast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub(super) fn check<'tcx>(
6666
&& let QPath::Resolved(None, Path { res, .. }) = qpath
6767
&& let Res::Local(hir_id) = res
6868
&& let parent = cx.tcx.parent_hir_node(*hir_id)
69-
&& let Node::Local(local) = parent
69+
&& let Node::LetStmt(local) = parent
7070
{
7171
if let Some(ty) = local.ty
7272
&& let TyKind::Path(qpath) = ty.kind
@@ -275,7 +275,7 @@ fn is_cast_from_ty_alias<'tcx>(cx: &LateContext<'tcx>, expr: impl Visitable<'tcx
275275
}
276276
// Local usage
277277
} else if let Res::Local(hir_id) = res
278-
&& let Node::Local(l) = cx.tcx.parent_hir_node(hir_id)
278+
&& let Node::LetStmt(l) = cx.tcx.parent_hir_node(hir_id)
279279
{
280280
if let Some(e) = l.init
281281
&& is_cast_from_ty_alias(cx, e, cast_from)

clippy_lints/src/ignored_unit_patterns.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl<'tcx> LateLintPass<'tcx> for IgnoredUnitPatterns {
4646
// Ignore function parameters
4747
return;
4848
},
49-
Node::Local(local) if local.ty.is_some() => {
49+
Node::LetStmt(local) if local.ty.is_some() => {
5050
// Ignore let bindings with explicit type
5151
return;
5252
},

clippy_lints/src/loops/same_item_push.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub(super) fn check<'tcx>(
6262
if let Node::Pat(pat) = node
6363
&& let PatKind::Binding(bind_ann, ..) = pat.kind
6464
&& !matches!(bind_ann, BindingAnnotation(_, Mutability::Mut))
65-
&& let Node::Local(parent_let_expr) = cx.tcx.parent_hir_node(hir_id)
65+
&& let Node::LetStmt(parent_let_expr) = cx.tcx.parent_hir_node(hir_id)
6666
&& let Some(init) = parent_let_expr.init
6767
{
6868
match init.kind {

clippy_lints/src/manual_rem_euclid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl<'tcx> LateLintPass<'tcx> for ManualRemEuclid {
8181
// Apply only to params or locals with annotated types
8282
match cx.tcx.parent_hir_node(hir_id) {
8383
Node::Param(..) => (),
84-
Node::Local(local) => {
84+
Node::LetStmt(local) => {
8585
let Some(ty) = local.ty else { return };
8686
if matches!(ty.kind, TyKind::Infer) {
8787
return;

clippy_lints/src/matches/match_single_binding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub(crate) fn check<'a>(cx: &LateContext<'a>, ex: &Expr<'a>, arms: &[Arm<'_>], e
148148
fn opt_parent_assign_span<'a>(cx: &LateContext<'a>, ex: &Expr<'a>) -> Option<AssignmentExpr> {
149149
if let Node::Expr(parent_arm_expr) = cx.tcx.parent_hir_node(ex.hir_id) {
150150
return match cx.tcx.parent_hir_node(parent_arm_expr.hir_id) {
151-
Node::Local(parent_let_expr) => Some(AssignmentExpr::Local {
151+
Node::LetStmt(parent_let_expr) => Some(AssignmentExpr::Local {
152152
span: parent_let_expr.span,
153153
pat_span: parent_let_expr.pat.span(),
154154
}),

clippy_lints/src/matches/needless_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fn strip_return<'hir>(expr: &'hir Expr<'hir>) -> &'hir Expr<'hir> {
125125
fn expr_ty_matches_p_ty(cx: &LateContext<'_>, expr: &Expr<'_>, p_expr: &Expr<'_>) -> bool {
126126
match cx.tcx.parent_hir_node(p_expr.hir_id) {
127127
// Compare match_expr ty with local in `let local = match match_expr {..}`
128-
Node::Local(local) => {
128+
Node::LetStmt(local) => {
129129
let results = cx.typeck_results();
130130
return same_type_and_consts(results.node_type(local.hir_id), results.expr_ty(expr));
131131
},

clippy_lints/src/methods/clone_on_copy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub(super) fn check(
6969
_ => false,
7070
},
7171
// local binding capturing a reference
72-
Node::Local(l) if matches!(l.pat.kind, PatKind::Binding(BindingAnnotation(ByRef::Yes, _), ..)) => {
72+
Node::LetStmt(l) if matches!(l.pat.kind, PatKind::Binding(BindingAnnotation(ByRef::Yes, _), ..)) => {
7373
return;
7474
},
7575
_ => false,

clippy_lints/src/methods/iter_on_single_or_empty_collections.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, method_name: &str, re
5050
| ExprKind::Break(_, _) => true,
5151
_ => false,
5252
},
53-
Some((Node::Stmt(_) | Node::Local(_), _)) => false,
53+
Some((Node::Stmt(_) | Node::LetStmt(_), _)) => false,
5454
_ => true,
5555
};
5656

clippy_lints/src/methods/needless_collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub(super) fn check<'tcx>(
8585
);
8686
}
8787
},
88-
Node::Local(l) => {
88+
Node::LetStmt(l) => {
8989
if let PatKind::Binding(BindingAnnotation::NONE | BindingAnnotation::MUT, id, _, None) = l.pat.kind
9090
&& let ty = cx.typeck_results().expr_ty(collect_expr)
9191
&& [sym::Vec, sym::VecDeque, sym::BinaryHeap, sym::LinkedList]

clippy_lints/src/methods/readonly_write_lock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, receiver
2424
&& let Node::Expr(unwrap_call_expr) = cx.tcx.parent_hir_node(expr.hir_id)
2525
&& is_unwrap_call(cx, unwrap_call_expr)
2626
&& let parent = cx.tcx.parent_hir_node(unwrap_call_expr.hir_id)
27-
&& let Node::Local(local) = parent
27+
&& let Node::LetStmt(local) = parent
2828
&& let Some(mir) = enclosing_mir(cx.tcx, expr.hir_id)
2929
&& let Some((local, _)) = mir
3030
.local_decls

clippy_lints/src/methods/str_splitn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn check_manual_split_once_indirect(
128128
) -> Option<()> {
129129
let ctxt = expr.span.ctxt();
130130
let mut parents = cx.tcx.hir().parent_iter(expr.hir_id);
131-
if let (_, Node::Local(local)) = parents.next()?
131+
if let (_, Node::LetStmt(local)) = parents.next()?
132132
&& let PatKind::Binding(BindingAnnotation::MUT, iter_binding_id, iter_ident, None) = local.pat.kind
133133
&& let (iter_stmt_id, Node::Stmt(_)) = parents.next()?
134134
&& let (_, Node::Block(enclosing_block)) = parents.next()?

clippy_lints/src/methods/unnecessary_fold.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn needs_turbofish(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> bool {
2020

2121
// some common cases where turbofish isn't needed:
2222
// - assigned to a local variable with a type annotation
23-
if let hir::Node::Local(local) = parent
23+
if let hir::Node::LetStmt(local) = parent
2424
&& local.ty.is_some()
2525
{
2626
return false;

clippy_lints/src/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ fn check_ptr_arg_usage<'tcx>(cx: &LateContext<'tcx>, body: &'tcx Body<'_>, args:
604604

605605
match get_expr_use_or_unification_node(self.cx.tcx, e) {
606606
Some((Node::Stmt(_), _)) => (),
607-
Some((Node::Local(l), _)) => {
607+
Some((Node::LetStmt(l), _)) => {
608608
// Only trace simple bindings. e.g `let x = y;`
609609
if let PatKind::Binding(BindingAnnotation::NONE, id, _, None) = l.pat.kind {
610610
self.bindings.insert(id, args_idx);

clippy_lints/src/shadow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ fn find_init<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Expr<'
241241
ExprKind::Match(e, _, _) | ExprKind::Let(&LetExpr { init: e, .. }) => Some(e),
242242
_ => None,
243243
},
244-
Node::Local(local) => local.init,
244+
Node::LetStmt(local) => local.init,
245245
_ => None,
246246
};
247247
return init;

clippy_lints/src/tuple_array_conversions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ fn all_bindings_are_for_conv<'tcx>(
159159
.iter()
160160
.map(|node| match node {
161161
Node::Pat(pat) => kind.eq(&pat.kind).then_some(pat.hir_id),
162-
Node::Local(l) => Some(l.hir_id),
162+
Node::LetStmt(l) => Some(l.hir_id),
163163
_ => None,
164164
})
165165
.all_equal()
@@ -170,7 +170,7 @@ fn all_bindings_are_for_conv<'tcx>(
170170
&& local_parents.first().is_some_and(|node| {
171171
let Some(ty) = match node {
172172
Node::Pat(pat) => Some(pat.hir_id),
173-
Node::Local(l) => Some(l.hir_id),
173+
Node::LetStmt(l) => Some(l.hir_id),
174174
_ => None,
175175
}
176176
.map(|hir_id| cx.typeck_results().node_type(hir_id)) else {

clippy_lints/src/undocumented_unsafe_blocks.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ fn block_parents_have_safety_comment(
342342
) -> bool {
343343
let (span, hir_id) = match cx.tcx.parent_hir_node(id) {
344344
Node::Expr(expr) => match cx.tcx.parent_hir_node(expr.hir_id) {
345-
Node::Local(hir::LetStmt { span, hir_id, .. }) => (*span, *hir_id),
345+
Node::LetStmt(hir::LetStmt { span, hir_id, .. }) => (*span, *hir_id),
346346
Node::Item(hir::Item {
347347
kind: hir::ItemKind::Const(..) | ItemKind::Static(..),
348348
span,
@@ -363,7 +363,7 @@ fn block_parents_have_safety_comment(
363363
| hir::StmtKind::Semi(hir::Expr { span, hir_id, .. }),
364364
..
365365
})
366-
| Node::Local(hir::LetStmt { span, hir_id, .. }) => (*span, *hir_id),
366+
| Node::LetStmt(hir::LetStmt { span, hir_id, .. }) => (*span, *hir_id),
367367
Node::Item(hir::Item {
368368
kind: hir::ItemKind::Const(..) | ItemKind::Static(..),
369369
span,
@@ -603,7 +603,7 @@ fn get_body_search_span(cx: &LateContext<'_>) -> Option<Span> {
603603
for (_, node) in map.parent_iter(body.hir_id) {
604604
match node {
605605
Node::Expr(e) => span = e.span,
606-
Node::Block(_) | Node::Arm(_) | Node::Stmt(_) | Node::Local(_) => (),
606+
Node::Block(_) | Node::Arm(_) | Node::Stmt(_) | Node::LetStmt(_) => (),
607607
Node::Item(hir::Item {
608608
kind: hir::ItemKind::Const(..) | ItemKind::Static(..),
609609
..

clippy_lints/src/unit_types/let_unit_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ fn expr_needs_inferred_result<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) -
102102
return false;
103103
}
104104
while let Some(id) = locals_to_check.pop() {
105-
if let Node::Local(l) = cx.tcx.parent_hir_node(id) {
105+
if let Node::LetStmt(l) = cx.tcx.parent_hir_node(id) {
106106
if !l.ty.map_or(true, |ty| matches!(ty.kind, TyKind::Infer)) {
107107
return false;
108108
}

clippy_lints/src/unused_peekable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl<'tcx> Visitor<'tcx> for PeekableVisitor<'_, 'tcx> {
190190
},
191191
}
192192
},
193-
Node::Local(LetStmt { init: Some(init), .. }) => {
193+
Node::LetStmt(LetStmt { init: Some(init), .. }) => {
194194
if arg_is_mut_peekable(self.cx, init) {
195195
self.found_peek_call = true;
196196
}

clippy_lints/src/utils/internal_lints/metadata_collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ fn get_parent_local<'hir>(cx: &LateContext<'hir>, expr: &'hir hir::Expr<'hir>) -
10061006

10071007
fn get_parent_local_hir_id<'hir>(cx: &LateContext<'hir>, hir_id: hir::HirId) -> Option<&'hir hir::Local<'hir>> {
10081008
match cx.tcx.parent_hir_node(hir_id) {
1009-
hir::Node::Local(local) => Some(local),
1009+
hir::Node::LetStmt(local) => Some(local),
10101010
hir::Node::Pat(pattern) => get_parent_local_hir_id(cx, pattern.hir_id),
10111011
_ => None,
10121012
}

clippy_lints/src/utils/internal_lints/unnecessary_def_path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ fn path_to_matched_type(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> Option<Ve
217217
match peel_hir_expr_refs(expr).0.kind {
218218
ExprKind::Path(ref qpath) => match cx.qpath_res(qpath, expr.hir_id) {
219219
Res::Local(hir_id) => {
220-
if let Node::Local(Local { init: Some(init), .. }) = cx.tcx.parent_hir_node(hir_id) {
220+
if let Node::LetStmt(Local { init: Some(init), .. }) = cx.tcx.parent_hir_node(hir_id) {
221221
path_to_matched_type(cx, init)
222222
} else {
223223
None

clippy_lints/src/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'tcx> LateLintPass<'tcx> for UselessVec {
6363
match cx.tcx.parent_hir_node(expr.hir_id) {
6464
// search for `let foo = vec![_]` expressions where all uses of `foo`
6565
// adjust to slices or call a method that exist on slices (e.g. len)
66-
Node::Local(LetStmt {
66+
Node::LetStmt(LetStmt {
6767
ty: None,
6868
pat:
6969
Pat {
@@ -93,7 +93,7 @@ impl<'tcx> LateLintPass<'tcx> for UselessVec {
9393
}
9494
},
9595
// if the local pattern has a specified type, do not lint.
96-
Node::Local(LetStmt { ty: Some(_), .. }) if higher::VecArgs::hir(cx, expr).is_some() => {
96+
Node::LetStmt(LetStmt { ty: Some(_), .. }) if higher::VecArgs::hir(cx, expr).is_some() => {
9797
self.span_to_lint_map.insert(callsite, None);
9898
},
9999
// search for `for _ in vec![...]`

clippy_lints/src/zero_repeat_side_effects.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn inner_check(cx: &LateContext<'_>, expr: &'_ rustc_hir::Expr<'_>, inner_expr:
7878
let parent_hir_node = cx.tcx.parent_hir_node(expr.hir_id);
7979
let return_type = cx.typeck_results().expr_ty(expr);
8080

81-
if let Node::Local(l) = parent_hir_node {
81+
if let Node::LetStmt(l) = parent_hir_node {
8282
array_span_lint(
8383
cx,
8484
l.span,

clippy_utils/src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ pub fn expr_or_init<'a, 'b, 'tcx: 'b>(cx: &LateContext<'tcx>, mut expr: &'a Expr
184184
pub fn find_binding_init<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Expr<'tcx>> {
185185
if let Node::Pat(pat) = cx.tcx.hir_node(hir_id)
186186
&& matches!(pat.kind, PatKind::Binding(BindingAnnotation::NONE, ..))
187-
&& let Node::Local(local) = cx.tcx.parent_hir_node(hir_id)
187+
&& let Node::LetStmt(local) = cx.tcx.parent_hir_node(hir_id)
188188
{
189189
return local.init;
190190
}
@@ -1079,7 +1079,7 @@ pub fn capture_local_usage(cx: &LateContext<'_>, e: &Expr<'_>) -> CaptureKind {
10791079
},
10801080
_ => break,
10811081
},
1082-
Node::Local(l) => match pat_capture_kind(cx, l.pat) {
1082+
Node::LetStmt(l) => match pat_capture_kind(cx, l.pat) {
10831083
CaptureKind::Value => break,
10841084
capture @ CaptureKind::Ref(_) => return capture,
10851085
},
@@ -1357,7 +1357,7 @@ pub fn get_enclosing_loop_or_multi_call_closure<'tcx>(
13571357
ExprKind::Closure { .. } | ExprKind::Loop(..) => return Some(e),
13581358
_ => (),
13591359
},
1360-
Node::Stmt(_) | Node::Block(_) | Node::Local(_) | Node::Arm(_) => (),
1360+
Node::Stmt(_) | Node::Block(_) | Node::LetStmt(_) | Node::Arm(_) => (),
13611361
_ => break,
13621362
}
13631363
}
@@ -1462,7 +1462,7 @@ pub fn is_else_clause(tcx: TyCtxt<'_>, expr: &Expr<'_>) -> bool {
14621462
pub fn is_inside_let_else(tcx: TyCtxt<'_>, expr: &Expr<'_>) -> bool {
14631463
let mut child_id = expr.hir_id;
14641464
for (parent_id, node) in tcx.hir().parent_iter(child_id) {
1465-
if let Node::Local(LetStmt {
1465+
if let Node::LetStmt(LetStmt {
14661466
init: Some(init),
14671467
els: Some(els),
14681468
..
@@ -1482,7 +1482,7 @@ pub fn is_inside_let_else(tcx: TyCtxt<'_>, expr: &Expr<'_>) -> bool {
14821482
pub fn is_else_clause_in_let_else(tcx: TyCtxt<'_>, expr: &Expr<'_>) -> bool {
14831483
let mut child_id = expr.hir_id;
14841484
for (parent_id, node) in tcx.hir().parent_iter(child_id) {
1485-
if let Node::Local(LetStmt { els: Some(els), .. }) = node
1485+
if let Node::LetStmt(LetStmt { els: Some(els), .. }) = node
14861486
&& els.hir_id == child_id
14871487
{
14881488
return true;
@@ -2639,7 +2639,7 @@ pub struct ExprUseCtxt<'tcx> {
26392639
/// The node which consumes a value.
26402640
pub enum ExprUseNode<'tcx> {
26412641
/// Assignment to, or initializer for, a local
2642-
Local(&'tcx LetStmt<'tcx>),
2642+
LetStmt(&'tcx LetStmt<'tcx>),
26432643
/// Initializer for a const or static item.
26442644
ConstStatic(OwnerId),
26452645
/// Implicit or explicit return from a function.
@@ -2671,7 +2671,7 @@ impl<'tcx> ExprUseNode<'tcx> {
26712671
/// Gets the needed type as it's defined without any type inference.
26722672
pub fn defined_ty(&self, cx: &LateContext<'tcx>) -> Option<DefinedTy<'tcx>> {
26732673
match *self {
2674-
Self::Local(LetStmt { ty: Some(ty), .. }) => Some(DefinedTy::Hir(ty)),
2674+
Self::LetStmt(LetStmt { ty: Some(ty), .. }) => Some(DefinedTy::Hir(ty)),
26752675
Self::ConstStatic(id) => Some(DefinedTy::Mir(
26762676
cx.param_env
26772677
.and(Binder::dummy(cx.tcx.type_of(id).instantiate_identity())),
@@ -2731,7 +2731,7 @@ impl<'tcx> ExprUseNode<'tcx> {
27312731
let sig = cx.tcx.fn_sig(id).skip_binder();
27322732
Some(DefinedTy::Mir(cx.tcx.param_env(id).and(sig.input(i))))
27332733
},
2734-
Self::Local(_) | Self::FieldAccess(..) | Self::Callee | Self::Expr | Self::Other => None,
2734+
Self::LetStmt(_) | Self::FieldAccess(..) | Self::Callee | Self::Expr | Self::Other => None,
27352735
}
27362736
}
27372737
}
@@ -2770,7 +2770,7 @@ pub fn expr_use_ctxt<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'tcx>) -> Optio
27702770
.continue_value()
27712771
.map(|(use_node, child_id)| {
27722772
let node = match use_node {
2773-
Node::Local(l) => ExprUseNode::Local(l),
2773+
Node::LetStmt(l) => ExprUseNode::LetStmt(l),
27742774
Node::ExprField(field) => ExprUseNode::Field(field),
27752775

27762776
Node::Item(&Item {

clippy_utils/src/ty/type_certainty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ fn path_segment_certainty(
242242
Node::Param(..) => Certainty::Certain(None),
243243
// A local's type is certain if its type annotation is certain or it has an initializer whose
244244
// type is certain.
245-
Node::Local(local) => {
245+
Node::LetStmt(local) => {
246246
let lhs = local.ty.map_or(Certainty::Uncertain, |ty| type_certainty(cx, ty));
247247
let rhs = local
248248
.init

0 commit comments

Comments
 (0)