Skip to content

Commit ffd573e

Browse files
ty.kind -> ty.kind() in rustdoc and clippy
1 parent 90e519e commit ffd573e

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

+177
-177
lines changed

src/librustdoc/clean/blanket_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
3838
);
3939
let trait_ref = self.cx.tcx.impl_trait_ref(impl_def_id).unwrap();
4040
let may_apply = self.cx.tcx.infer_ctxt().enter(|infcx| {
41-
match trait_ref.self_ty().kind {
41+
match trait_ref.self_ty().kind() {
4242
ty::Param(_) => {}
4343
_ => return false,
4444
}

src/librustdoc/clean/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -747,17 +747,17 @@ impl<'a, 'tcx> Clean<Generics> for (&'a ty::Generics, ty::GenericPredicates<'tcx
747747
let param_idx = (|| {
748748
match p.skip_binders() {
749749
ty::PredicateAtom::Trait(pred, _constness) => {
750-
if let ty::Param(param) = pred.self_ty().kind {
750+
if let ty::Param(param) = pred.self_ty().kind() {
751751
return Some(param.index);
752752
}
753753
}
754754
ty::PredicateAtom::TypeOutlives(ty::OutlivesPredicate(ty, _reg)) => {
755-
if let ty::Param(param) = ty.kind {
755+
if let ty::Param(param) = ty.kind() {
756756
return Some(param.index);
757757
}
758758
}
759759
ty::PredicateAtom::Projection(p) => {
760-
if let ty::Param(param) = p.projection_ty.self_ty().kind {
760+
if let ty::Param(param) = p.projection_ty.self_ty().kind() {
761761
projection = Some(ty::Binder::bind(p));
762762
return Some(param.index);
763763
}
@@ -1171,7 +1171,7 @@ impl Clean<Item> for ty::AssocItem {
11711171
let self_arg_ty = sig.input(0).skip_binder();
11721172
if self_arg_ty == self_ty {
11731173
decl.inputs.values[0].type_ = Generic(String::from("Self"));
1174-
} else if let ty::Ref(_, ty, _) = self_arg_ty.kind {
1174+
} else if let ty::Ref(_, ty, _) = *self_arg_ty.kind() {
11751175
if ty == self_ty {
11761176
match decl.inputs.values[0].type_ {
11771177
BorrowedRef { ref mut type_, .. } => {
@@ -1473,7 +1473,7 @@ impl Clean<Type> for hir::Ty<'_> {
14731473
TyKind::Path(hir::QPath::TypeRelative(ref qself, ref segment)) => {
14741474
let mut res = Res::Err;
14751475
let ty = hir_ty_to_ty(cx.tcx, self);
1476-
if let ty::Projection(proj) = ty.kind {
1476+
if let ty::Projection(proj) = ty.kind() {
14771477
res = Res::Def(DefKind::Trait, proj.trait_ref(cx.tcx).def_id);
14781478
}
14791479
let trait_path = hir::Path { span: self.span, res, segments: &[] };
@@ -1513,7 +1513,7 @@ impl Clean<Type> for hir::Ty<'_> {
15131513
impl<'tcx> Clean<Type> for Ty<'tcx> {
15141514
fn clean(&self, cx: &DocContext<'_>) -> Type {
15151515
debug!("cleaning type: {:?}", self);
1516-
match self.kind {
1516+
match *self.kind() {
15171517
ty::Never => Never,
15181518
ty::Bool => Primitive(PrimitiveType::Bool),
15191519
ty::Char => Primitive(PrimitiveType::Char),

src/librustdoc/clean/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pub fn external_generic_args(
127127
None
128128
}
129129
GenericArgKind::Type(ty) => {
130-
ty_kind = Some(&ty.kind);
130+
ty_kind = Some(ty.kind());
131131
Some(GenericArg::Type(ty.clean(cx)))
132132
}
133133
GenericArgKind::Const(ct) => Some(GenericArg::Const(ct.clean(cx))),
@@ -497,7 +497,7 @@ pub fn print_const(cx: &DocContext<'_>, n: &'tcx ty::Const<'_>) -> String {
497497
pub fn print_evaluated_const(cx: &DocContext<'_>, def_id: DefId) -> Option<String> {
498498
cx.tcx.const_eval_poly(def_id).ok().and_then(|val| {
499499
let ty = cx.tcx.type_of(def_id);
500-
match (val, &ty.kind) {
500+
match (val, ty.kind()) {
501501
(_, &ty::Ref(..)) => None,
502502
(ConstValue::Scalar(_), &ty::Adt(_, _)) => None,
503503
(ConstValue::Scalar(_), _) => {
@@ -522,7 +522,7 @@ fn format_integer_with_underscore_sep(num: &str) -> String {
522522
fn print_const_with_custom_print_scalar(cx: &DocContext<'_>, ct: &'tcx ty::Const<'tcx>) -> String {
523523
// Use a slightly different format for integer types which always shows the actual value.
524524
// For all other types, fallback to the original `pretty_print_const`.
525-
match (ct.val, &ct.ty.kind) {
525+
match (ct.val, ct.ty.kind()) {
526526
(ty::ConstKind::Value(ConstValue::Scalar(Scalar::Raw { data, .. })), ty::Uint(ui)) => {
527527
format!("{}{}", format_integer_with_underscore_sep(&data.to_string()), ui.name_str())
528528
}

src/librustdoc/passes/collect_intra_doc_links.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
113113
{
114114
return Err(ErrorKind::ResolutionFailure);
115115
}
116-
match cx.tcx.type_of(did).kind {
116+
match cx.tcx.type_of(did).kind() {
117117
ty::Adt(def, _) if def.is_enum() => {
118118
if def.all_fields().any(|item| item.ident.name == variant_field_name) {
119119
Ok((
@@ -350,7 +350,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
350350
Ok((ty_res, Some(format!("{}.{}", out, item_name))))
351351
}
352352
} else {
353-
match cx.tcx.type_of(did).kind {
353+
match *cx.tcx.type_of(did).kind() {
354354
ty::Adt(def, _) => {
355355
if let Some(item) = if def.is_enum() {
356356
def.all_fields().find(|item| item.ident.name == item_name)

src/tools/clippy/clippy_lints/src/atomic_ordering.rs

Lines changed: 1 addition & 1 deletion
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]))

src/tools/clippy/clippy_lints/src/await_holding_lock.rs

Lines changed: 1 addition & 1 deletion
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,

src/tools/clippy/clippy_lints/src/bytecount.rs

Lines changed: 1 addition & 1 deletion
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, _) =

src/tools/clippy/clippy_lints/src/consts.rs

Lines changed: 12 additions & 12 deletions
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_undef_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_undef_and_ptr_outside_interpreter(0..(4 * len as usize))

src/tools/clippy/clippy_lints/src/default_trait_access.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<'tcx> LateLintPass<'tcx> for DefaultTraitAccess {
5555
// TODO: Work out a way to put "whatever the imported way of referencing
5656
// this type in this file" rather than a fully-qualified type.
5757
let expr_ty = cx.typeck_results().expr_ty(expr);
58-
if let ty::Adt(..) = expr_ty.kind {
58+
if let ty::Adt(..) = expr_ty.kind() {
5959
let replacement = format!("{}::default()", expr_ty);
6060
span_lint_and_sugg(
6161
cx,

src/tools/clippy/clippy_lints/src/derive.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,20 +187,20 @@ fn check_copy_clone<'tcx>(cx: &LateContext<'tcx>, item: &Item<'_>, trait_ref: &T
187187
return;
188188
}
189189

190-
match ty.kind {
190+
match *ty.kind() {
191191
ty::Adt(def, _) if def.is_union() => return,
192192

193193
// Some types are not Clone by default but could be cloned “by hand” if necessary
194194
ty::Adt(def, substs) => {
195195
for variant in &def.variants {
196196
for field in &variant.fields {
197-
if let ty::FnDef(..) = field.ty(cx.tcx, substs).kind {
197+
if let ty::FnDef(..) = field.ty(cx.tcx, substs).kind() {
198198
return;
199199
}
200200
}
201201
for subst in substs {
202202
if let ty::subst::GenericArgKind::Type(subst) = subst.unpack() {
203-
if let ty::Param(_) = subst.kind {
203+
if let ty::Param(_) = subst.kind() {
204204
return;
205205
}
206206
}
@@ -241,7 +241,7 @@ fn check_unsafe_derive_deserialize<'tcx>(
241241

242242
if_chain! {
243243
if match_path(&trait_ref.path, &paths::SERDE_DESERIALIZE);
244-
if let ty::Adt(def, _) = ty.kind;
244+
if let ty::Adt(def, _) = ty.kind();
245245
if def.did.is_local();
246246
if cx.tcx.inherent_impls(def.did)
247247
.iter()

src/tools/clippy/clippy_lints/src/doc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ fn lint_for_missing_headers<'tcx>(
232232
let mir = cx.tcx.optimized_mir(def_id.to_def_id());
233233
let ret_ty = mir.return_ty();
234234
if implements_trait(cx, ret_ty, future, &[]);
235-
if let ty::Opaque(_, subs) = ret_ty.kind;
235+
if let ty::Opaque(_, subs) = ret_ty.kind();
236236
if let Some(gen) = subs.types().next();
237-
if let ty::Generator(_, subs, _) = gen.kind;
237+
if let ty::Generator(_, subs, _) = gen.kind();
238238
if is_type_diagnostic_item(cx, subs.as_generator().return_ty(), sym!(result_type));
239239
then {
240240
span_lint(

src/tools/clippy/clippy_lints/src/drop_forget_ref.rs

Lines changed: 1 addition & 1 deletion
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();

src/tools/clippy/clippy_lints/src/enum_clike.rs

Lines changed: 2 additions & 2 deletions
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() {

src/tools/clippy/clippy_lints/src/eta_reduction.rs

Lines changed: 4 additions & 4 deletions
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(),

src/tools/clippy/clippy_lints/src/eval_order_dependence.rs

Lines changed: 2 additions & 2 deletions
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
},

src/tools/clippy/clippy_lints/src/float_literal.rs

Lines changed: 1 addition & 1 deletion
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 {

src/tools/clippy/clippy_lints/src/floating_point_arithmetic.rs

Lines changed: 1 addition & 1 deletion
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 {

src/tools/clippy/clippy_lints/src/format.rs

Lines changed: 1 addition & 1 deletion
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 {

0 commit comments

Comments
 (0)