We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
hir::Let
hir::LetExpr
1 parent 76096ef commit 54d1260Copy full SHA for 54d1260
clippy_lints/src/pattern_type_mismatch.rs
@@ -1,5 +1,5 @@
1
use clippy_utils::diagnostics::span_lint_and_help;
2
-use rustc_hir::{intravisit, Body, Expr, ExprKind, FnDecl, Let, LocalSource, Mutability, Pat, PatKind, Stmt, StmtKind};
+use rustc_hir::{intravisit, Body, Expr, ExprKind, FnDecl, LetExpr, LocalSource, Mutability, Pat, PatKind, Stmt, StmtKind};
3
use rustc_lint::{LateContext, LateLintPass, LintContext};
4
use rustc_middle::lint::in_external_macro;
5
use rustc_middle::ty;
@@ -103,7 +103,7 @@ impl<'tcx> LateLintPass<'tcx> for PatternTypeMismatch {
103
}
104
105
106
- if let ExprKind::Let(Let { pat, .. }) = expr.kind {
+ if let ExprKind::Let(LetExpr { pat, .. }) = expr.kind {
107
apply_lint(cx, pat, DerefPossible::Possible);
108
109
clippy_lints/src/shadow.rs
@@ -5,7 +5,7 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_hir::def::Res;
6
use rustc_hir::def_id::LocalDefId;
7
use rustc_hir::hir_id::ItemLocalId;
8
-use rustc_hir::{Block, Body, BodyOwnerKind, Expr, ExprKind, HirId, Let, Node, Pat, PatKind, QPath, UnOp};
+use rustc_hir::{Block, Body, BodyOwnerKind, Expr, ExprKind, HirId, LetExpr, Node, Pat, PatKind, QPath, UnOp};
9
use rustc_lint::{LateContext, LateLintPass};
10
use rustc_session::impl_lint_pass;
11
use rustc_span::{Span, Symbol};
@@ -238,7 +238,7 @@ fn find_init<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Expr<'
238
let init = match node {
239
Node::Arm(_) | Node::Pat(_) => continue,
240
Node::Expr(expr) => match expr.kind {
241
- ExprKind::Match(e, _, _) | ExprKind::Let(&Let { init: e, .. }) => Some(e),
+ ExprKind::Match(e, _, _) | ExprKind::Let(&LetExpr { init: e, .. }) => Some(e),
242
_ => None,
243
},
244
Node::Local(local) => local.init,
clippy_lints/src/unused_io_amount.rs
@@ -131,7 +131,7 @@ fn non_consuming_ok_arm<'a>(cx: &LateContext<'a>, arm: &hir::Arm<'a>) -> bool {
131
fn check_expr<'a>(cx: &LateContext<'a>, expr: &'a hir::Expr<'a>) {
132
match expr.kind {
133
hir::ExprKind::If(cond, _, _)
134
- if let ExprKind::Let(hir::Let { pat, init, .. }) = cond.kind
+ if let ExprKind::Let(hir::LetExpr { pat, init, .. }) = cond.kind
135
&& is_ok_wild_or_dotdot_pattern(cx, pat)
136
&& let Some(op) = should_lint(cx, init) =>
137
{
clippy_utils/src/higher.rs
@@ -102,7 +102,7 @@ impl<'hir> IfLet<'hir> {
102
if let ExprKind::If(
Expr {
kind:
- ExprKind::Let(&hir::Let {
+ ExprKind::Let(&hir::LetExpr {
pat: let_pat,
init: let_expr,
span: let_span,
@@ -379,7 +379,7 @@ impl<'hir> WhileLet<'hir> {
379
ExprKind::If(
380
381
382
383
384
385
clippy_utils/src/hir_utils.rs
@@ -8,7 +8,7 @@ use rustc_hir::def::Res;
use rustc_hir::MatchSource::TryDesugar;
use rustc_hir::{
ArrayLen, BinOpKind, BindingAnnotation, Block, BodyId, Closure, Expr, ExprField, ExprKind, FnRetTy, GenericArg,
- GenericArgs, HirId, HirIdMap, InlineAsmOperand, Let, Lifetime, LifetimeName, Pat, PatField, PatKind, Path,
+ GenericArgs, HirId, HirIdMap, InlineAsmOperand, LetExpr, Lifetime, LifetimeName, Pat, PatField, PatKind, Path,
12
PathSegment, PrimTy, QPath, Stmt, StmtKind, Ty, TyKind, TypeBinding,
13
};
14
use rustc_lexer::{tokenize, TokenKind};
@@ -837,7 +837,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
837
838
839
840
- ExprKind::Let(Let { pat, init, ty, .. }) => {
+ ExprKind::Let(LetExpr { pat, init, ty, .. }) => {
841
self.hash_expr(init);
842
if let Some(ty) = ty {
843
self.hash_ty(ty);
clippy_utils/src/visitors.rs
@@ -5,7 +5,7 @@ use rustc_hir as hir;
use rustc_hir::def::{CtorKind, DefKind, Res};
use rustc_hir::intravisit::{self, walk_block, walk_expr, Visitor};
- AnonConst, Arm, Block, BlockCheckMode, Body, BodyId, Expr, ExprKind, HirId, ItemId, ItemKind, Let, Pat, QPath,
+ AnonConst, Arm, Block, BlockCheckMode, Body, BodyId, Expr, ExprKind, HirId, ItemId, ItemKind, LetExpr, Pat, QPath,
Stmt, UnOp, UnsafeSource, Unsafety,
use rustc_lint::LateContext;
@@ -624,7 +624,7 @@ pub fn for_each_unconsumed_temporary<'tcx, B>(
624
| ExprKind::Field(e, _)
625
| ExprKind::Unary(UnOp::Deref, e)
626
| ExprKind::Match(e, ..)
627
- | ExprKind::Let(&Let { init: e, .. }) => {
+ | ExprKind::Let(&LetExpr { init: e, .. }) => {
628
helper(typeck, false, e, f)?;
629
630
ExprKind::Block(&Block { expr: Some(e), .. }, _) | ExprKind::Cast(e, _) | ExprKind::Unary(_, e) => {
0 commit comments