Skip to content

Commit f253dd0

Browse files
committed
Auto merge of rust-lang#6007 - ebroto:sync-from-rust, r=ebroto
Rustup r? @ghost changelog: none
2 parents b9e35df + 2905fff commit f253dd0

Some content is hidden

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

58 files changed

+190
-191
lines changed

clippy_lints/src/atomic_ordering.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const ATOMIC_TYPES: [&str; 12] = [
5353
];
5454

5555
fn type_is_atomic(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
56-
if let ty::Adt(&ty::AdtDef { did, .. }, _) = cx.typeck_results().expr_ty(expr).kind {
56+
if let ty::Adt(&ty::AdtDef { did, .. }, _) = cx.typeck_results().expr_ty(expr).kind() {
5757
ATOMIC_TYPES
5858
.iter()
5959
.any(|ty| match_def_path(cx, did, &["core", "sync", "atomic", ty]))

clippy_lints/src/await_holding_lock.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl LateLintPass<'_> for AwaitHoldingLock {
6767

6868
fn check_interior_types(cx: &LateContext<'_>, ty_causes: &[GeneratorInteriorTypeCause<'_>], span: Span) {
6969
for ty_cause in ty_causes {
70-
if let rustc_middle::ty::Adt(adt, _) = ty_cause.ty.kind {
70+
if let rustc_middle::ty::Adt(adt, _) = ty_cause.ty.kind() {
7171
if is_mutex_guard(cx, adt.did) {
7272
span_lint_and_note(
7373
cx,

clippy_lints/src/bytecount.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'tcx> LateLintPass<'tcx> for ByteCount {
6363
_ => { return; }
6464
}
6565
};
66-
if ty::Uint(UintTy::U8) != walk_ptrs_ty(cx.typeck_results().expr_ty(needle)).kind {
66+
if ty::Uint(UintTy::U8) != *walk_ptrs_ty(cx.typeck_results().expr_ty(needle)).kind() {
6767
return;
6868
}
6969
let haystack = if let ExprKind::MethodCall(ref path, _, ref args, _) =

clippy_lints/src/consts.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl Constant {
123123
(&Self::Str(ref ls), &Self::Str(ref rs)) => Some(ls.cmp(rs)),
124124
(&Self::Char(ref l), &Self::Char(ref r)) => Some(l.cmp(r)),
125125
(&Self::Int(l), &Self::Int(r)) => {
126-
if let ty::Int(int_ty) = cmp_type.kind {
126+
if let ty::Int(int_ty) = *cmp_type.kind() {
127127
Some(sext(tcx, l, int_ty).cmp(&sext(tcx, r, int_ty)))
128128
} else {
129129
Some(l.cmp(&r))
@@ -162,7 +162,7 @@ pub fn lit_to_constant(lit: &LitKind, ty: Option<Ty<'_>>) -> Constant {
162162
FloatTy::F32 => Constant::F32(is.as_str().parse().unwrap()),
163163
FloatTy::F64 => Constant::F64(is.as_str().parse().unwrap()),
164164
},
165-
LitKind::Float(ref is, LitFloatType::Unsuffixed) => match ty.expect("type of float is known").kind {
165+
LitKind::Float(ref is, LitFloatType::Unsuffixed) => match ty.expect("type of float is known").kind() {
166166
ty::Float(FloatTy::F32) => Constant::F32(is.as_str().parse().unwrap()),
167167
ty::Float(FloatTy::F64) => Constant::F64(is.as_str().parse().unwrap()),
168168
_ => bug!(),
@@ -230,7 +230,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
230230
ExprKind::Array(ref vec) => self.multi(vec).map(Constant::Vec),
231231
ExprKind::Tup(ref tup) => self.multi(tup).map(Constant::Tuple),
232232
ExprKind::Repeat(ref value, _) => {
233-
let n = match self.typeck_results.expr_ty(e).kind {
233+
let n = match self.typeck_results.expr_ty(e).kind() {
234234
ty::Array(_, n) => n.try_eval_usize(self.lcx.tcx, self.lcx.param_env)?,
235235
_ => span_bug!(e.span, "typeck error"),
236236
};
@@ -281,7 +281,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
281281
Bool(b) => Some(Bool(!b)),
282282
Int(value) => {
283283
let value = !value;
284-
match ty.kind {
284+
match *ty.kind() {
285285
ty::Int(ity) => Some(Int(unsext(self.lcx.tcx, value as i128, ity))),
286286
ty::Uint(ity) => Some(Int(clip(self.lcx.tcx, value, ity))),
287287
_ => None,
@@ -295,7 +295,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
295295
use self::Constant::{Int, F32, F64};
296296
match *o {
297297
Int(value) => {
298-
let ity = match ty.kind {
298+
let ity = match *ty.kind() {
299299
ty::Int(ity) => ity,
300300
_ => return None,
301301
};
@@ -402,7 +402,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
402402
let l = self.expr(left)?;
403403
let r = self.expr(right);
404404
match (l, r) {
405-
(Constant::Int(l), Some(Constant::Int(r))) => match self.typeck_results.expr_ty_opt(left)?.kind {
405+
(Constant::Int(l), Some(Constant::Int(r))) => match *self.typeck_results.expr_ty_opt(left)?.kind() {
406406
ty::Int(ity) => {
407407
let l = sext(self.lcx.tcx, l, ity);
408408
let r = sext(self.lcx.tcx, r, ity);
@@ -495,7 +495,7 @@ pub fn miri_to_const(result: &ty::Const<'_>) -> Option<Constant> {
495495
use rustc_middle::mir::interpret::{ConstValue, Scalar};
496496
match result.val {
497497
ty::ConstKind::Value(ConstValue::Scalar(Scalar::Raw { data: d, .. })) => {
498-
match result.ty.kind {
498+
match result.ty.kind() {
499499
ty::Bool => Some(Constant::Bool(d == 1)),
500500
ty::Uint(_) | ty::Int(_) => Some(Constant::Int(d)),
501501
ty::Float(FloatTy::F32) => Some(Constant::F32(f32::from_bits(
@@ -505,7 +505,7 @@ pub fn miri_to_const(result: &ty::Const<'_>) -> Option<Constant> {
505505
d.try_into().expect("invalid f64 bit representation"),
506506
))),
507507
ty::RawPtr(type_and_mut) => {
508-
if let ty::Uint(_) = type_and_mut.ty.kind {
508+
if let ty::Uint(_) = type_and_mut.ty.kind() {
509509
return Some(Constant::RawPtr(d));
510510
}
511511
None
@@ -514,8 +514,8 @@ pub fn miri_to_const(result: &ty::Const<'_>) -> Option<Constant> {
514514
_ => None,
515515
}
516516
},
517-
ty::ConstKind::Value(ConstValue::Slice { data, start, end }) => match result.ty.kind {
518-
ty::Ref(_, tam, _) => match tam.kind {
517+
ty::ConstKind::Value(ConstValue::Slice { data, start, end }) => match result.ty.kind() {
518+
ty::Ref(_, tam, _) => match tam.kind() {
519519
ty::Str => String::from_utf8(
520520
data.inspect_with_uninit_and_ptr_outside_interpreter(start..end)
521521
.to_owned(),
@@ -526,8 +526,8 @@ pub fn miri_to_const(result: &ty::Const<'_>) -> Option<Constant> {
526526
},
527527
_ => None,
528528
},
529-
ty::ConstKind::Value(ConstValue::ByRef { alloc, offset: _ }) => match result.ty.kind {
530-
ty::Array(sub_type, len) => match sub_type.kind {
529+
ty::ConstKind::Value(ConstValue::ByRef { alloc, offset: _ }) => match result.ty.kind() {
530+
ty::Array(sub_type, len) => match sub_type.kind() {
531531
ty::Float(FloatTy::F32) => match miri_to_const(len) {
532532
Some(Constant::Int(len)) => alloc
533533
.inspect_with_uninit_and_ptr_outside_interpreter(0..(4 * len as usize))

clippy_lints/src/default_trait_access.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl<'tcx> LateLintPass<'tcx> for DefaultTraitAccess {
4242
if let QPath::Resolved(None, _path) = qpath;
4343
then {
4444
let expr_ty = cx.typeck_results().expr_ty(expr);
45-
if let ty::Adt(def, ..) = expr_ty.kind {
45+
if let ty::Adt(def, ..) = expr_ty.kind() {
4646
// TODO: Work out a way to put "whatever the imported way of referencing
4747
// this type in this file" rather than a fully-qualified type.
4848
let replacement = format!("{}::default()", cx.tcx.def_path_str(def.did));

clippy_lints/src/derive.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -299,20 +299,20 @@ fn check_copy_clone<'tcx>(cx: &LateContext<'tcx>, item: &Item<'_>, trait_ref: &T
299299
return;
300300
}
301301

302-
match ty.kind {
302+
match *ty.kind() {
303303
ty::Adt(def, _) if def.is_union() => return,
304304

305305
// Some types are not Clone by default but could be cloned “by hand” if necessary
306306
ty::Adt(def, substs) => {
307307
for variant in &def.variants {
308308
for field in &variant.fields {
309-
if let ty::FnDef(..) = field.ty(cx.tcx, substs).kind {
309+
if let ty::FnDef(..) = field.ty(cx.tcx, substs).kind() {
310310
return;
311311
}
312312
}
313313
for subst in substs {
314314
if let ty::subst::GenericArgKind::Type(subst) = subst.unpack() {
315-
if let ty::Param(_) = subst.kind {
315+
if let ty::Param(_) = subst.kind() {
316316
return;
317317
}
318318
}
@@ -353,7 +353,7 @@ fn check_unsafe_derive_deserialize<'tcx>(
353353

354354
if_chain! {
355355
if match_path(&trait_ref.path, &paths::SERDE_DESERIALIZE);
356-
if let ty::Adt(def, _) = ty.kind;
356+
if let ty::Adt(def, _) = ty.kind();
357357
if let Some(local_def_id) = def.did.as_local();
358358
let adt_hir_id = cx.tcx.hir().local_def_id_to_hir_id(local_def_id);
359359
if !is_allowed(cx, UNSAFE_DERIVE_DESERIALIZE, adt_hir_id);

clippy_lints/src/doc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ fn lint_for_missing_headers<'tcx>(
239239
let mir = cx.tcx.optimized_mir(def_id.to_def_id());
240240
let ret_ty = mir.return_ty();
241241
if implements_trait(cx, ret_ty, future, &[]);
242-
if let ty::Opaque(_, subs) = ret_ty.kind;
242+
if let ty::Opaque(_, subs) = ret_ty.kind();
243243
if let Some(gen) = subs.types().next();
244-
if let ty::Generator(_, subs, _) = gen.kind;
244+
if let ty::Generator(_, subs, _) = gen.kind();
245245
if is_type_diagnostic_item(cx, subs.as_generator().return_ty(), sym!(result_type));
246246
then {
247247
span_lint(

clippy_lints/src/drop_forget_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetRef {
121121
let arg = &args[0];
122122
let arg_ty = cx.typeck_results().expr_ty(arg);
123123

124-
if let ty::Ref(..) = arg_ty.kind {
124+
if let ty::Ref(..) = arg_ty.kind() {
125125
if match_def_path(cx, def_id, &paths::DROP) {
126126
lint = DROP_REF;
127127
msg = DROP_REF_SUMMARY.to_string();

clippy_lints/src/enum_clike.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ impl<'tcx> LateLintPass<'tcx> for UnportableVariant {
5353
.ok()
5454
.map(|val| rustc_middle::ty::Const::from_value(cx.tcx, val, ty));
5555
if let Some(Constant::Int(val)) = constant.and_then(miri_to_const) {
56-
if let ty::Adt(adt, _) = ty.kind {
56+
if let ty::Adt(adt, _) = ty.kind() {
5757
if adt.is_enum() {
5858
ty = adt.repr.discr_type().to_ty(cx.tcx);
5959
}
6060
}
61-
match ty.kind {
61+
match ty.kind() {
6262
ty::Int(IntTy::Isize) => {
6363
let val = ((val as i128) << 64) >> 64;
6464
if i32::try_from(val).is_ok() {

clippy_lints/src/eta_reduction.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn check_closure(cx: &LateContext<'_>, expr: &Expr<'_>) {
9999

100100
let fn_ty = cx.typeck_results().expr_ty(caller);
101101

102-
if matches!(fn_ty.kind, ty::FnDef(_, _) | ty::FnPtr(_) | ty::Closure(_, _));
102+
if matches!(fn_ty.kind(), ty::FnDef(_, _) | ty::FnPtr(_) | ty::Closure(_, _));
103103

104104
if !type_is_unsafe_function(cx, fn_ty);
105105

@@ -173,14 +173,14 @@ fn get_ufcs_type_name(cx: &LateContext<'_>, method_def_id: def_id::DefId, self_a
173173
}
174174

175175
fn match_borrow_depth(lhs: Ty<'_>, rhs: Ty<'_>) -> bool {
176-
match (&lhs.kind, &rhs.kind) {
176+
match (&lhs.kind(), &rhs.kind()) {
177177
(ty::Ref(_, t1, mut1), ty::Ref(_, t2, mut2)) => mut1 == mut2 && match_borrow_depth(&t1, &t2),
178178
(l, r) => !matches!((l, r), (ty::Ref(_, _, _), _) | (_, ty::Ref(_, _, _))),
179179
}
180180
}
181181

182182
fn match_types(lhs: Ty<'_>, rhs: Ty<'_>) -> bool {
183-
match (&lhs.kind, &rhs.kind) {
183+
match (&lhs.kind(), &rhs.kind()) {
184184
(ty::Bool, ty::Bool)
185185
| (ty::Char, ty::Char)
186186
| (ty::Int(_), ty::Int(_))
@@ -194,7 +194,7 @@ fn match_types(lhs: Ty<'_>, rhs: Ty<'_>) -> bool {
194194
}
195195

196196
fn get_type_name(cx: &LateContext<'_>, ty: Ty<'_>) -> String {
197-
match ty.kind {
197+
match ty.kind() {
198198
ty::Adt(t, _) => cx.tcx.def_path_str(t.did),
199199
ty::Ref(_, r, _) => get_type_name(cx, &r),
200200
_ => ty.to_string(),

clippy_lints/src/eval_order_dependence.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ impl<'a, 'tcx> Visitor<'tcx> for DivergenceVisitor<'a, 'tcx> {
138138
ExprKind::Continue(_) | ExprKind::Break(_, _) | ExprKind::Ret(_) => self.report_diverging_sub_expr(e),
139139
ExprKind::Call(ref func, _) => {
140140
let typ = self.cx.typeck_results().expr_ty(func);
141-
match typ.kind {
141+
match typ.kind() {
142142
ty::FnDef(..) | ty::FnPtr(_) => {
143143
let sig = typ.fn_sig(self.cx.tcx);
144-
if let ty::Never = self.cx.tcx.erase_late_bound_regions(&sig).output().kind {
144+
if let ty::Never = self.cx.tcx.erase_late_bound_regions(&sig).output().kind() {
145145
self.report_diverging_sub_expr(e);
146146
}
147147
},

clippy_lints/src/float_equality_without_abs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ impl<'tcx> LateLintPass<'tcx> for FloatEqualityWithoutAbs {
8181
// values of the substractions on the left hand side are of the type float
8282
let t_val_l = cx.typeck_results().expr_ty(val_l);
8383
let t_val_r = cx.typeck_results().expr_ty(val_r);
84-
if let ty::Float(_) = t_val_l.kind;
85-
if let ty::Float(_) = t_val_r.kind;
84+
if let ty::Float(_) = t_val_l.kind();
85+
if let ty::Float(_) = t_val_r.kind();
8686

8787
then {
8888
let sug_l = sugg::Sugg::hir(cx, &val_l, "..");

clippy_lints/src/float_literal.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<'tcx> LateLintPass<'tcx> for FloatLiteral {
6262
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) {
6363
if_chain! {
6464
let ty = cx.typeck_results().expr_ty(expr);
65-
if let ty::Float(fty) = ty.kind;
65+
if let ty::Float(fty) = *ty.kind();
6666
if let hir::ExprKind::Lit(ref lit) = expr.kind;
6767
if let LitKind::Float(sym, lit_float_ty) = lit.node;
6868
then {

clippy_lints/src/floating_point_arithmetic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ fn prepare_receiver_sugg<'a>(cx: &LateContext<'_>, mut expr: &'a Expr<'a>) -> Su
136136
if_chain! {
137137
// if the expression is a float literal and it is unsuffixed then
138138
// add a suffix so the suggestion is valid and unambiguous
139-
if let ty::Float(float_ty) = cx.typeck_results().expr_ty(expr).kind;
139+
if let ty::Float(float_ty) = cx.typeck_results().expr_ty(expr).kind();
140140
if let ExprKind::Lit(lit) = &expr.kind;
141141
if let ast::LitKind::Float(sym, ast::LitFloatType::Unsuffixed) = lit.node;
142142
then {

clippy_lints/src/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn on_argumentv1_new<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, arms: &
9191
if pats.len() == 1;
9292
then {
9393
let ty = walk_ptrs_ty(cx.typeck_results().pat_ty(&pats[0]));
94-
if ty.kind != rustc_middle::ty::Str && !is_type_diagnostic_item(cx, ty, sym!(string_type)) {
94+
if *ty.kind() != rustc_middle::ty::Str && !is_type_diagnostic_item(cx, ty, sym!(string_type)) {
9595
return None;
9696
}
9797
if let ExprKind::Lit(ref lit) = format_args.kind {

clippy_lints/src/functions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ fn is_mutable_pat(cx: &LateContext<'_>, pat: &hir::Pat<'_>, tys: &mut FxHashSet<
505505
static KNOWN_WRAPPER_TYS: &[&[&str]] = &[&["alloc", "rc", "Rc"], &["std", "sync", "Arc"]];
506506

507507
fn is_mutable_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, span: Span, tys: &mut FxHashSet<DefId>) -> bool {
508-
match ty.kind {
508+
match *ty.kind() {
509509
// primitive types are never mutable
510510
ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Str => false,
511511
ty::Adt(ref adt, ref substs) => {

clippy_lints/src/future_not_send.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
6161
return;
6262
}
6363
let ret_ty = utils::return_ty(cx, hir_id);
64-
if let Opaque(id, subst) = ret_ty.kind {
64+
if let Opaque(id, subst) = *ret_ty.kind() {
6565
let preds = cx.tcx.predicates_of(id).instantiate(cx.tcx, subst);
6666
let mut is_future = false;
6767
for p in preds.predicates {

clippy_lints/src/identity_op.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ fn is_allowed(cx: &LateContext<'_>, cmp: BinOp, left: &Expr<'_>, right: &Expr<'_
7575
#[allow(clippy::cast_possible_wrap)]
7676
fn check(cx: &LateContext<'_>, e: &Expr<'_>, m: i8, span: Span, arg: Span) {
7777
if let Some(Constant::Int(v)) = constant_simple(cx, cx.typeck_results(), e) {
78-
let check = match cx.typeck_results().expr_ty(e).kind {
78+
let check = match *cx.typeck_results().expr_ty(e).kind() {
7979
ty::Int(ity) => unsext(cx.tcx, -1_i128, ity),
8080
ty::Uint(uty) => clip(cx.tcx, !0, uty),
8181
_ => return,

clippy_lints/src/indexing_slicing.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl<'tcx> LateLintPass<'tcx> for IndexingSlicing {
9191
let ty = cx.typeck_results().expr_ty(array);
9292
if let Some(range) = higher::range(index) {
9393
// Ranged indexes, i.e., &x[n..m], &x[n..], &x[..n] and &x[..]
94-
if let ty::Array(_, s) = ty.kind {
94+
if let ty::Array(_, s) = ty.kind() {
9595
let size: u128 = if let Some(size) = s.try_eval_usize(cx.tcx, cx.param_env) {
9696
size.into()
9797
} else {
@@ -141,7 +141,7 @@ impl<'tcx> LateLintPass<'tcx> for IndexingSlicing {
141141
span_lint_and_help(cx, INDEXING_SLICING, expr.span, "slicing may panic.", None, help_msg);
142142
} else {
143143
// Catchall non-range index, i.e., [n] or [n << m]
144-
if let ty::Array(..) = ty.kind {
144+
if let ty::Array(..) = ty.kind() {
145145
// Index is a constant uint.
146146
if let Some(..) = constant(cx, cx.typeck_results(), index) {
147147
// Let rustc's `const_err` lint handle constant `usize` indexing on arrays.

clippy_lints/src/large_const_arrays.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'tcx> LateLintPass<'tcx> for LargeConstArrays {
5151
if !item.span.from_expansion();
5252
if let ItemKind::Const(hir_ty, _) = &item.kind;
5353
let ty = hir_ty_to_ty(cx.tcx, hir_ty);
54-
if let ty::Array(element_type, cst) = ty.kind;
54+
if let ty::Array(element_type, cst) = ty.kind();
5555
if let ConstKind::Value(val) = cst.val;
5656
if let ConstValue::Scalar(element_count) = val;
5757
if let Ok(element_count) = element_count.to_machine_usize(&cx.tcx);

clippy_lints/src/large_stack_arrays.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl<'tcx> LateLintPass<'tcx> for LargeStackArrays {
4242
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
4343
if_chain! {
4444
if let ExprKind::Repeat(_, _) = expr.kind;
45-
if let ty::Array(element_type, cst) = cx.typeck_results().expr_ty(expr).kind;
45+
if let ty::Array(element_type, cst) = cx.typeck_results().expr_ty(expr).kind();
4646
if let ConstKind::Value(val) = cst.val;
4747
if let ConstValue::Scalar(element_count) = val;
4848
if let Ok(element_count) = element_count.to_machine_usize(&cx.tcx);

clippy_lints/src/len_zero.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ fn has_is_empty(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
286286
}
287287

288288
let ty = &walk_ptrs_ty(cx.typeck_results().expr_ty(expr));
289-
match ty.kind {
289+
match ty.kind() {
290290
ty::Dynamic(ref tt, ..) => tt.principal().map_or(false, |principal| {
291291
cx.tcx
292292
.associated_items(principal.def_id())

0 commit comments

Comments
 (0)