Skip to content

Commit edd9047

Browse files
committed
Auto merge of #4591 - flip1995:rustup, r=flip1995
Rustup to #64813 cc #64843 changelog: none
2 parents bca08a6 + fff6b0e commit edd9047

File tree

155 files changed

+927
-982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+927
-982
lines changed

clippy_lints/src/approx_const.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ declare_lint_pass!(ApproxConstant => [APPROX_CONSTANT]);
5454

5555
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ApproxConstant {
5656
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
57-
if let ExprKind::Lit(lit) = &e.node {
57+
if let ExprKind::Lit(lit) = &e.kind {
5858
check_lit(cx, &lit.node, e);
5959
}
6060
}

clippy_lints/src/arithmetic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Arithmetic {
6363
return;
6464
}
6565
}
66-
match &expr.node {
66+
match &expr.kind {
6767
hir::ExprKind::Binary(op, l, r) | hir::ExprKind::AssignOp(op, l, r) => {
6868
match op.node {
6969
hir::BinOpKind::And

clippy_lints/src/assertions_on_constants.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ declare_lint_pass!(AssertionsOnConstants => [ASSERTIONS_ON_CONSTANTS]);
3232
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssertionsOnConstants {
3333
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
3434
let lint_assert_cb = |is_debug_assert: bool| {
35-
if let ExprKind::Unary(_, ref lit) = e.node {
35+
if let ExprKind::Unary(_, ref lit) = e.kind {
3636
if let Some((Constant::Bool(is_true), _)) = constant(cx, cx.tables, lit) {
3737
if is_true {
3838
span_help_and_lint(

clippy_lints/src/assign_ops.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ declare_lint_pass!(AssignOps => [ASSIGN_OP_PATTERN, MISREFACTORED_ASSIGN_OP]);
5959
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
6060
#[allow(clippy::too_many_lines)]
6161
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
62-
match &expr.node {
62+
match &expr.kind {
6363
hir::ExprKind::AssignOp(op, lhs, rhs) => {
64-
if let hir::ExprKind::Binary(binop, l, r) = &rhs.node {
64+
if let hir::ExprKind::Binary(binop, l, r) = &rhs.kind {
6565
if op.node != binop.node {
6666
return;
6767
}
@@ -76,7 +76,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
7676
}
7777
},
7878
hir::ExprKind::Assign(assignee, e) => {
79-
if let hir::ExprKind::Binary(op, l, r) = &e.node {
79+
if let hir::ExprKind::Binary(op, l, r) = &e.kind {
8080
#[allow(clippy::cognitive_complexity)]
8181
let lint = |assignee: &hir::Expr, rhs: &hir::Expr| {
8282
let ty = cx.tables.expr_ty(assignee);

clippy_lints/src/attrs.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Attributes {
212212
for item in items {
213213
if_chain! {
214214
if let NestedMetaItem::MetaItem(mi) = &item;
215-
if let MetaItemKind::NameValue(lit) = &mi.node;
215+
if let MetaItemKind::NameValue(lit) = &mi.kind;
216216
if mi.check_name(sym!(since));
217217
then {
218218
check_semver(cx, item.span(), lit);
@@ -227,7 +227,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Attributes {
227227
if is_relevant_item(cx, item) {
228228
check_attrs(cx, item.span, item.ident.name, &item.attrs)
229229
}
230-
match item.node {
230+
match item.kind {
231231
ItemKind::ExternCrate(..) | ItemKind::Use(..) => {
232232
let skip_unused_imports = item.attrs.iter().any(|attr| attr.check_name(sym!(macro_use)));
233233

@@ -242,7 +242,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Attributes {
242242
// whitelist `unused_imports`, `deprecated` and `unreachable_pub` for `use` items
243243
// and `unused_imports` for `extern crate` items with `macro_use`
244244
for lint in lint_list {
245-
match item.node {
245+
match item.kind {
246246
ItemKind::Use(..) => {
247247
if is_word(lint, sym!(unused_imports))
248248
|| is_word(lint, sym!(deprecated))
@@ -355,22 +355,22 @@ fn check_clippy_lint_names(cx: &LateContext<'_, '_>, items: &[NestedMetaItem]) {
355355
}
356356

357357
fn is_relevant_item(cx: &LateContext<'_, '_>, item: &Item) -> bool {
358-
if let ItemKind::Fn(_, _, _, eid) = item.node {
358+
if let ItemKind::Fn(_, _, _, eid) = item.kind {
359359
is_relevant_expr(cx, cx.tcx.body_tables(eid), &cx.tcx.hir().body(eid).value)
360360
} else {
361361
true
362362
}
363363
}
364364

365365
fn is_relevant_impl(cx: &LateContext<'_, '_>, item: &ImplItem) -> bool {
366-
match item.node {
366+
match item.kind {
367367
ImplItemKind::Method(_, eid) => is_relevant_expr(cx, cx.tcx.body_tables(eid), &cx.tcx.hir().body(eid).value),
368368
_ => false,
369369
}
370370
}
371371

372372
fn is_relevant_trait(cx: &LateContext<'_, '_>, item: &TraitItem) -> bool {
373-
match item.node {
373+
match item.kind {
374374
TraitItemKind::Method(_, TraitMethod::Required(_)) => true,
375375
TraitItemKind::Method(_, TraitMethod::Provided(eid)) => {
376376
is_relevant_expr(cx, cx.tcx.body_tables(eid), &cx.tcx.hir().body(eid).value)
@@ -381,7 +381,7 @@ fn is_relevant_trait(cx: &LateContext<'_, '_>, item: &TraitItem) -> bool {
381381

382382
fn is_relevant_block(cx: &LateContext<'_, '_>, tables: &ty::TypeckTables<'_>, block: &Block) -> bool {
383383
if let Some(stmt) = block.stmts.first() {
384-
match &stmt.node {
384+
match &stmt.kind {
385385
StmtKind::Local(_) => true,
386386
StmtKind::Expr(expr) | StmtKind::Semi(expr) => is_relevant_expr(cx, tables, expr),
387387
_ => false,
@@ -392,12 +392,12 @@ fn is_relevant_block(cx: &LateContext<'_, '_>, tables: &ty::TypeckTables<'_>, bl
392392
}
393393

394394
fn is_relevant_expr(cx: &LateContext<'_, '_>, tables: &ty::TypeckTables<'_>, expr: &Expr) -> bool {
395-
match &expr.node {
395+
match &expr.kind {
396396
ExprKind::Block(block, _) => is_relevant_block(cx, tables, block),
397397
ExprKind::Ret(Some(e)) => is_relevant_expr(cx, tables, e),
398398
ExprKind::Ret(None) | ExprKind::Break(_, None) => false,
399399
ExprKind::Call(path_expr, _) => {
400-
if let ExprKind::Path(qpath) = &path_expr.node {
400+
if let ExprKind::Path(qpath) = &path_expr.kind {
401401
if let Some(fun_id) = tables.qpath_res(qpath, path_expr.hir_id).opt_def_id() {
402402
!match_def_path(cx, fun_id, &paths::BEGIN_PANIC)
403403
} else {
@@ -464,7 +464,7 @@ fn check_attrs(cx: &LateContext<'_, '_>, span: Span, name: Name, attrs: &[Attrib
464464
}
465465

466466
fn check_semver(cx: &LateContext<'_, '_>, span: Span, lit: &Lit) {
467-
if let LitKind::Str(is, _) = lit.node {
467+
if let LitKind::Str(is, _) = lit.kind {
468468
if Version::parse(&is.as_str()).is_ok() {
469469
return;
470470
}

clippy_lints/src/bit_mask.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl_lint_pass!(BitMask => [BAD_BIT_MASK, INEFFECTIVE_BIT_MASK, VERBOSE_BIT_MASK
111111

112112
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BitMask {
113113
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
114-
if let ExprKind::Binary(cmp, left, right) = &e.node {
114+
if let ExprKind::Binary(cmp, left, right) = &e.kind {
115115
if cmp.node.is_comparison() {
116116
if let Some(cmp_opt) = fetch_int_literal(cx, right) {
117117
check_compare(cx, left, cmp.node, cmp_opt, e.span)
@@ -121,13 +121,13 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BitMask {
121121
}
122122
}
123123
if_chain! {
124-
if let ExprKind::Binary(op, left, right) = &e.node;
124+
if let ExprKind::Binary(op, left, right) = &e.kind;
125125
if BinOpKind::Eq == op.node;
126-
if let ExprKind::Binary(op1, left1, right1) = &left.node;
126+
if let ExprKind::Binary(op1, left1, right1) = &left.kind;
127127
if BinOpKind::BitAnd == op1.node;
128-
if let ExprKind::Lit(lit) = &right1.node;
128+
if let ExprKind::Lit(lit) = &right1.kind;
129129
if let LitKind::Int(n, _) = lit.node;
130-
if let ExprKind::Lit(lit1) = &right.node;
130+
if let ExprKind::Lit(lit1) = &right.kind;
131131
if let LitKind::Int(0, _) = lit1.node;
132132
if n.leading_zeros() == n.count_zeros();
133133
if n > u128::from(self.verbose_bit_mask_threshold);
@@ -163,7 +163,7 @@ fn invert_cmp(cmp: BinOpKind) -> BinOpKind {
163163
}
164164

165165
fn check_compare(cx: &LateContext<'_, '_>, bit_op: &Expr, cmp_op: BinOpKind, cmp_value: u128, span: Span) {
166-
if let ExprKind::Binary(op, left, right) = &bit_op.node {
166+
if let ExprKind::Binary(op, left, right) = &bit_op.kind {
167167
if op.node != BinOpKind::BitAnd && op.node != BinOpKind::BitOr {
168168
return;
169169
}

clippy_lints/src/blacklisted_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl_lint_pass!(BlacklistedName => [BLACKLISTED_NAME]);
3737

3838
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BlacklistedName {
3939
fn check_pat(&mut self, cx: &LateContext<'a, 'tcx>, pat: &'tcx Pat) {
40-
if let PatKind::Binding(.., ident, _) = pat.node {
40+
if let PatKind::Binding(.., ident, _) = pat.kind {
4141
if self.blacklist.contains(&ident.name.to_string()) {
4242
span_lint(
4343
cx,

clippy_lints/src/block_in_if_condition.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ struct ExVisitor<'a, 'tcx> {
5151

5252
impl<'a, 'tcx> Visitor<'tcx> for ExVisitor<'a, 'tcx> {
5353
fn visit_expr(&mut self, expr: &'tcx Expr) {
54-
if let ExprKind::Closure(_, _, eid, _, _) = expr.node {
54+
if let ExprKind::Closure(_, _, eid, _, _) = expr.kind {
5555
let body = self.cx.tcx.hir().body(eid);
5656
let ex = &body.value;
57-
if matches!(ex.node, ExprKind::Block(_, _)) && !body.value.span.from_expansion() {
57+
if matches!(ex.kind, ExprKind::Block(_, _)) && !body.value.span.from_expansion() {
5858
self.found_block = Some(ex);
5959
return;
6060
}
@@ -76,7 +76,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BlockInIfCondition {
7676
return;
7777
}
7878
if let Some((check, then, _)) = higher::if_block(&expr) {
79-
if let ExprKind::Block(block, _) = &check.node {
79+
if let ExprKind::Block(block, _) = &check.kind {
8080
if block.rules == DefaultBlock {
8181
if block.stmts.is_empty() {
8282
if let Some(ex) = &block.expr {

clippy_lints/src/booleans.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct Hir2Qmm<'a, 'tcx, 'v> {
8181
impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
8282
fn extract(&mut self, op: BinOpKind, a: &[&'v Expr], mut v: Vec<Bool>) -> Result<Vec<Bool>, String> {
8383
for a in a {
84-
if let ExprKind::Binary(binop, lhs, rhs) = &a.node {
84+
if let ExprKind::Binary(binop, lhs, rhs) = &a.kind {
8585
if binop.node == op {
8686
v = self.extract(op, &[lhs, rhs], v)?;
8787
continue;
@@ -107,7 +107,7 @@ impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
107107

108108
// prevent folding of `cfg!` macros and the like
109109
if !e.span.from_expansion() {
110-
match &e.node {
110+
match &e.kind {
111111
ExprKind::Unary(UnNot, inner) => return Ok(Bool::Not(box self.run(inner)?)),
112112
ExprKind::Binary(binop, lhs, rhs) => match &binop.node {
113113
BinOpKind::Or => return Ok(Bool::Or(self.extract(BinOpKind::Or, &[lhs, rhs], Vec::new())?)),
@@ -129,9 +129,9 @@ impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
129129
}
130130

131131
if_chain! {
132-
if let ExprKind::Binary(e_binop, e_lhs, e_rhs) = &e.node;
132+
if let ExprKind::Binary(e_binop, e_lhs, e_rhs) = &e.kind;
133133
if implements_ord(self.cx, e_lhs);
134-
if let ExprKind::Binary(expr_binop, expr_lhs, expr_rhs) = &expr.node;
134+
if let ExprKind::Binary(expr_binop, expr_lhs, expr_rhs) = &expr.kind;
135135
if negate(e_binop.node) == Some(expr_binop.node);
136136
if SpanlessEq::new(self.cx).ignore_fn().eq_expr(e_lhs, expr_lhs);
137137
if SpanlessEq::new(self.cx).ignore_fn().eq_expr(e_rhs, expr_rhs);
@@ -222,7 +222,7 @@ impl<'a, 'tcx, 'v> SuggestContext<'a, 'tcx, 'v> {
222222
}
223223

224224
fn simplify_not(cx: &LateContext<'_, '_>, expr: &Expr) -> Option<String> {
225-
match &expr.node {
225+
match &expr.kind {
226226
ExprKind::Binary(binop, lhs, rhs) => {
227227
if !implements_ord(cx, lhs) {
228228
return None;
@@ -437,7 +437,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'a, 'tcx> {
437437
if in_macro(e.span) {
438438
return;
439439
}
440-
match &e.node {
440+
match &e.kind {
441441
ExprKind::Binary(binop, _, _) if binop.node == BinOpKind::Or || binop.node == BinOpKind::And => {
442442
self.bool_expr(e)
443443
},
@@ -467,7 +467,7 @@ struct NotSimplificationVisitor<'a, 'tcx> {
467467

468468
impl<'a, 'tcx> Visitor<'tcx> for NotSimplificationVisitor<'a, 'tcx> {
469469
fn visit_expr(&mut self, expr: &'tcx Expr) {
470-
if let ExprKind::Unary(UnNot, inner) = &expr.node {
470+
if let ExprKind::Unary(UnNot, inner) = &expr.kind {
471471
if let Some(suggestion) = simplify_not(self.cx, inner) {
472472
span_lint_and_sugg(
473473
self.cx,

clippy_lints/src/bytecount.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ declare_lint_pass!(ByteCount => [NAIVE_BYTECOUNT]);
3737
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ByteCount {
3838
fn check_expr(&mut self, cx: &LateContext<'_, '_>, expr: &Expr) {
3939
if_chain! {
40-
if let ExprKind::MethodCall(ref count, _, ref count_args) = expr.node;
40+
if let ExprKind::MethodCall(ref count, _, ref count_args) = expr.kind;
4141
if count.ident.name == sym!(count);
4242
if count_args.len() == 1;
43-
if let ExprKind::MethodCall(ref filter, _, ref filter_args) = count_args[0].node;
43+
if let ExprKind::MethodCall(ref filter, _, ref filter_args) = count_args[0].kind;
4444
if filter.ident.name == sym!(filter);
4545
if filter_args.len() == 2;
46-
if let ExprKind::Closure(_, _, body_id, _, _) = filter_args[1].node;
46+
if let ExprKind::Closure(_, _, body_id, _, _) = filter_args[1].kind;
4747
then {
4848
let body = cx.tcx.hir().body(body_id);
4949
if_chain! {
5050
if body.params.len() == 1;
5151
if let Some(argname) = get_pat_name(&body.params[0].pat);
52-
if let ExprKind::Binary(ref op, ref l, ref r) = body.value.node;
52+
if let ExprKind::Binary(ref op, ref l, ref r) = body.value.kind;
5353
if op.node == BinOpKind::Eq;
5454
if match_type(cx,
5555
walk_ptrs_ty(cx.tables.expr_ty(&filter_args[0])),
@@ -66,7 +66,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ByteCount {
6666
return;
6767
}
6868
let haystack = if let ExprKind::MethodCall(ref path, _, ref args) =
69-
filter_args[0].node {
69+
filter_args[0].kind {
7070
let p = path.ident.name;
7171
if (p == sym!(iter) || p == sym!(iter_mut)) && args.len() == 1 {
7272
&args[0]
@@ -100,7 +100,7 @@ fn check_arg(name: Name, arg: Name, needle: &Expr) -> bool {
100100
}
101101

102102
fn get_path_name(expr: &Expr) -> Option<Name> {
103-
match expr.node {
103+
match expr.kind {
104104
ExprKind::Box(ref e) | ExprKind::AddrOf(_, ref e) | ExprKind::Unary(UnOp::UnDeref, ref e) => get_path_name(e),
105105
ExprKind::Block(ref b, _) => {
106106
if b.stmts.is_empty() {

clippy_lints/src/checked_conversions.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CheckedConversions {
4444
fn check_expr(&mut self, cx: &LateContext<'_, '_>, item: &Expr) {
4545
let result = if_chain! {
4646
if !in_external_macro(cx.sess(), item.span);
47-
if let ExprKind::Binary(op, ref left, ref right) = &item.node;
47+
if let ExprKind::Binary(op, ref left, ref right) = &item.kind;
4848

4949
then {
5050
match op.node {
@@ -180,7 +180,7 @@ impl ConversionType {
180180
/// Check for `expr <= (to_type::max_value() as from_type)`
181181
fn check_upper_bound(expr: &Expr) -> Option<Conversion<'_>> {
182182
if_chain! {
183-
if let ExprKind::Binary(ref op, ref left, ref right) = &expr.node;
183+
if let ExprKind::Binary(ref op, ref left, ref right) = &expr.kind;
184184
if let Some((candidate, check)) = normalize_le_ge(op, left, right);
185185
if let Some((from, to)) = get_types_from_cast(check, MAX_VALUE, INTS);
186186

@@ -199,7 +199,7 @@ fn check_lower_bound(expr: &Expr) -> Option<Conversion<'_>> {
199199
}
200200

201201
// First of we need a binary containing the expression & the cast
202-
if let ExprKind::Binary(ref op, ref left, ref right) = &expr.node {
202+
if let ExprKind::Binary(ref op, ref left, ref right) = &expr.kind {
203203
normalize_le_ge(op, right, left).and_then(|(l, r)| check_function(l, r))
204204
} else {
205205
None
@@ -209,7 +209,7 @@ fn check_lower_bound(expr: &Expr) -> Option<Conversion<'_>> {
209209
/// Check for `expr >= 0`
210210
fn check_lower_bound_zero<'a>(candidate: &'a Expr, check: &'a Expr) -> Option<Conversion<'a>> {
211211
if_chain! {
212-
if let ExprKind::Lit(ref lit) = &check.node;
212+
if let ExprKind::Lit(ref lit) = &check.kind;
213213
if let LitKind::Int(0, _) = &lit.node;
214214

215215
then {
@@ -234,8 +234,8 @@ fn get_types_from_cast<'a>(expr: &'a Expr, func: &'a str, types: &'a [&str]) ->
234234
// `to_type::maxmin_value() as from_type`
235235
let call_from_cast: Option<(&Expr, &str)> = if_chain! {
236236
// to_type::maxmin_value(), from_type
237-
if let ExprKind::Cast(ref limit, ref from_type) = &expr.node;
238-
if let TyKind::Path(ref from_type_path) = &from_type.node;
237+
if let ExprKind::Cast(ref limit, ref from_type) = &expr.kind;
238+
if let TyKind::Path(ref from_type_path) = &from_type.kind;
239239
if let Some(from_sym) = int_ty_to_sym(from_type_path);
240240

241241
then {
@@ -249,12 +249,12 @@ fn get_types_from_cast<'a>(expr: &'a Expr, func: &'a str, types: &'a [&str]) ->
249249
let limit_from: Option<(&Expr, &str)> = call_from_cast.or_else(|| {
250250
if_chain! {
251251
// `from_type::from, to_type::maxmin_value()`
252-
if let ExprKind::Call(ref from_func, ref args) = &expr.node;
252+
if let ExprKind::Call(ref from_func, ref args) = &expr.kind;
253253
// `to_type::maxmin_value()`
254254
if args.len() == 1;
255255
if let limit = &args[0];
256256
// `from_type::from`
257-
if let ExprKind::Path(ref path) = &from_func.node;
257+
if let ExprKind::Path(ref path) = &from_func.kind;
258258
if let Some(from_sym) = get_implementing_type(path, INTS, FROM);
259259

260260
then {
@@ -267,9 +267,9 @@ fn get_types_from_cast<'a>(expr: &'a Expr, func: &'a str, types: &'a [&str]) ->
267267

268268
if let Some((limit, from_type)) = limit_from {
269269
if_chain! {
270-
if let ExprKind::Call(ref fun_name, _) = &limit.node;
270+
if let ExprKind::Call(ref fun_name, _) = &limit.kind;
271271
// `to_type, maxmin_value`
272-
if let ExprKind::Path(ref path) = &fun_name.node;
272+
if let ExprKind::Path(ref path) = &fun_name.kind;
273273
// `to_type`
274274
if let Some(to_type) = get_implementing_type(path, types, func);
275275

@@ -289,7 +289,7 @@ fn get_implementing_type<'a>(path: &QPath, candidates: &'a [&str], function: &st
289289
if_chain! {
290290
if let QPath::TypeRelative(ref ty, ref path) = &path;
291291
if path.ident.name.as_str() == function;
292-
if let TyKind::Path(QPath::Resolved(None, ref tp)) = &ty.node;
292+
if let TyKind::Path(QPath::Resolved(None, ref tp)) = &ty.kind;
293293
if let [int] = &*tp.segments;
294294
let name = &int.ident.name.as_str();
295295

clippy_lints/src/cognitive_complexity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ struct CCHelper {
110110
impl<'tcx> Visitor<'tcx> for CCHelper {
111111
fn visit_expr(&mut self, e: &'tcx Expr) {
112112
walk_expr(self, e);
113-
match e.node {
113+
match e.kind {
114114
ExprKind::Match(_, ref arms, _) => {
115115
if arms.len() > 1 {
116116
self.cc += 1;

0 commit comments

Comments
 (0)