Skip to content

Commit 68c32d1

Browse files
authored
Rollup merge of #122776 - GuillaumeGomez:rename-hir-let, r=oli-obk
Rename `hir::Let` into `hir::LetExpr` As discussed on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Improve.20naming.20of.20.60ExprKind.3A.3ALet.60.3F). r? `````@Zalathar`````
2 parents 26c2831 + 98f0050 commit 68c32d1

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

clippy_lints/src/pattern_type_mismatch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use clippy_utils::diagnostics::span_lint_and_help;
2-
use rustc_hir::{intravisit, Body, Expr, ExprKind, FnDecl, Let, LocalSource, Mutability, Pat, PatKind, Stmt, StmtKind};
2+
use rustc_hir::{intravisit, Body, Expr, ExprKind, FnDecl, LetExpr, LocalSource, Mutability, Pat, PatKind, Stmt, StmtKind};
33
use rustc_lint::{LateContext, LateLintPass, LintContext};
44
use rustc_middle::lint::in_external_macro;
55
use rustc_middle::ty;
@@ -103,7 +103,7 @@ impl<'tcx> LateLintPass<'tcx> for PatternTypeMismatch {
103103
}
104104
}
105105
}
106-
if let ExprKind::Let(Let { pat, .. }) = expr.kind {
106+
if let ExprKind::Let(LetExpr { pat, .. }) = expr.kind {
107107
apply_lint(cx, pat, DerefPossible::Possible);
108108
}
109109
}

clippy_lints/src/shadow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_data_structures::fx::FxHashMap;
55
use rustc_hir::def::Res;
66
use rustc_hir::def_id::LocalDefId;
77
use rustc_hir::hir_id::ItemLocalId;
8-
use rustc_hir::{Block, Body, BodyOwnerKind, Expr, ExprKind, HirId, Let, Node, Pat, PatKind, QPath, UnOp};
8+
use rustc_hir::{Block, Body, BodyOwnerKind, Expr, ExprKind, HirId, LetExpr, Node, Pat, PatKind, QPath, UnOp};
99
use rustc_lint::{LateContext, LateLintPass};
1010
use rustc_session::impl_lint_pass;
1111
use rustc_span::{Span, Symbol};
@@ -238,7 +238,7 @@ fn find_init<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Expr<'
238238
let init = match node {
239239
Node::Arm(_) | Node::Pat(_) => continue,
240240
Node::Expr(expr) => match expr.kind {
241-
ExprKind::Match(e, _, _) | ExprKind::Let(&Let { init: e, .. }) => Some(e),
241+
ExprKind::Match(e, _, _) | ExprKind::Let(&LetExpr { init: e, .. }) => Some(e),
242242
_ => None,
243243
},
244244
Node::Local(local) => local.init,

clippy_lints/src/unused_io_amount.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ fn non_consuming_ok_arm<'a>(cx: &LateContext<'a>, arm: &hir::Arm<'a>) -> bool {
131131
fn check_expr<'a>(cx: &LateContext<'a>, expr: &'a hir::Expr<'a>) {
132132
match expr.kind {
133133
hir::ExprKind::If(cond, _, _)
134-
if let ExprKind::Let(hir::Let { pat, init, .. }) = cond.kind
134+
if let ExprKind::Let(hir::LetExpr { pat, init, .. }) = cond.kind
135135
&& is_ok_wild_or_dotdot_pattern(cx, pat)
136136
&& let Some(op) = should_lint(cx, init) =>
137137
{

clippy_utils/src/higher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl<'hir> IfLet<'hir> {
102102
if let ExprKind::If(
103103
Expr {
104104
kind:
105-
ExprKind::Let(&hir::Let {
105+
ExprKind::Let(&hir::LetExpr {
106106
pat: let_pat,
107107
init: let_expr,
108108
span: let_span,
@@ -379,7 +379,7 @@ impl<'hir> WhileLet<'hir> {
379379
ExprKind::If(
380380
Expr {
381381
kind:
382-
ExprKind::Let(&hir::Let {
382+
ExprKind::Let(&hir::LetExpr {
383383
pat: let_pat,
384384
init: let_expr,
385385
span: let_span,

clippy_utils/src/hir_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_hir::def::Res;
88
use rustc_hir::MatchSource::TryDesugar;
99
use rustc_hir::{
1010
ArrayLen, BinOpKind, BindingAnnotation, Block, BodyId, Closure, Expr, ExprField, ExprKind, FnRetTy, GenericArg,
11-
GenericArgs, HirId, HirIdMap, InlineAsmOperand, Let, Lifetime, LifetimeName, Pat, PatField, PatKind, Path,
11+
GenericArgs, HirId, HirIdMap, InlineAsmOperand, LetExpr, Lifetime, LifetimeName, Pat, PatField, PatKind, Path,
1212
PathSegment, PrimTy, QPath, Stmt, StmtKind, Ty, TyKind, TypeBinding,
1313
};
1414
use rustc_lexer::{tokenize, TokenKind};
@@ -837,7 +837,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
837837
}
838838
}
839839
},
840-
ExprKind::Let(Let { pat, init, ty, .. }) => {
840+
ExprKind::Let(LetExpr { pat, init, ty, .. }) => {
841841
self.hash_expr(init);
842842
if let Some(ty) = ty {
843843
self.hash_ty(ty);

clippy_utils/src/visitors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_hir as hir;
55
use rustc_hir::def::{CtorKind, DefKind, Res};
66
use rustc_hir::intravisit::{self, walk_block, walk_expr, Visitor};
77
use rustc_hir::{
8-
AnonConst, Arm, Block, BlockCheckMode, Body, BodyId, Expr, ExprKind, HirId, ItemId, ItemKind, Let, Pat, QPath,
8+
AnonConst, Arm, Block, BlockCheckMode, Body, BodyId, Expr, ExprKind, HirId, ItemId, ItemKind, LetExpr, Pat, QPath,
99
Stmt, UnOp, UnsafeSource, Unsafety,
1010
};
1111
use rustc_lint::LateContext;
@@ -624,7 +624,7 @@ pub fn for_each_unconsumed_temporary<'tcx, B>(
624624
| ExprKind::Field(e, _)
625625
| ExprKind::Unary(UnOp::Deref, e)
626626
| ExprKind::Match(e, ..)
627-
| ExprKind::Let(&Let { init: e, .. }) => {
627+
| ExprKind::Let(&LetExpr { init: e, .. }) => {
628628
helper(typeck, false, e, f)?;
629629
},
630630
ExprKind::Block(&Block { expr: Some(e), .. }, _) | ExprKind::Cast(e, _) | ExprKind::Unary(_, e) => {

0 commit comments

Comments
 (0)