Skip to content

Commit c5a9e65

Browse files
committed
Enable unused_qualifications lint
1 parent 89aba8d commit c5a9e65

Some content is hidden

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

67 files changed

+349
-349
lines changed

clippy_config/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#![feature(rustc_private, let_chains)]
22
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
3-
#![warn(rust_2018_idioms, unused_lifetimes)]
3+
#![warn(
4+
trivial_casts,
5+
trivial_numeric_casts,
6+
rust_2018_idioms,
7+
unused_lifetimes,
8+
unused_qualifications
9+
)]
410
#![allow(
511
clippy::must_use_candidate,
612
clippy::missing_panics_doc,

clippy_dev/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
#![feature(let_chains)]
33
#![feature(rustc_private)]
44
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
5-
// warn on lints, that are included in `rust-lang/rust`s bootstrap
6-
#![warn(rust_2018_idioms, unused_lifetimes)]
5+
#![warn(
6+
trivial_casts,
7+
trivial_numeric_casts,
8+
rust_2018_idioms,
9+
unused_lifetimes,
10+
unused_qualifications
11+
)]
712

813
// The `rustc_driver` crate seems to be required in order to use the `rust_lexer` crate.
914
#[allow(unused_extern_crates)]

clippy_dev/src/update_lints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ fn replace_region_in_text<'a>(
992992
}
993993

994994
fn try_rename_file(old_name: &Path, new_name: &Path) -> bool {
995-
match fs::OpenOptions::new().create_new(true).write(true).open(new_name) {
995+
match OpenOptions::new().create_new(true).write(true).open(new_name) {
996996
Ok(file) => drop(file),
997997
Err(e) if matches!(e.kind(), io::ErrorKind::AlreadyExists | io::ErrorKind::NotFound) => return false,
998998
Err(e) => panic_file(e, new_name, "create"),
@@ -1016,7 +1016,7 @@ fn panic_file(error: io::Error, name: &Path, action: &str) -> ! {
10161016
}
10171017

10181018
fn rewrite_file(path: &Path, f: impl FnOnce(&str) -> Option<String>) {
1019-
let mut file = fs::OpenOptions::new()
1019+
let mut file = OpenOptions::new()
10201020
.write(true)
10211021
.read(true)
10221022
.open(path)

clippy_lints/src/assigning_clones.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl AssigningClones {
6565
impl_lint_pass!(AssigningClones => [ASSIGNING_CLONES]);
6666

6767
impl<'tcx> LateLintPass<'tcx> for AssigningClones {
68-
fn check_expr(&mut self, cx: &LateContext<'tcx>, assign_expr: &'tcx hir::Expr<'_>) {
68+
fn check_expr(&mut self, cx: &LateContext<'tcx>, assign_expr: &'tcx Expr<'_>) {
6969
if !self.msrv.meets(msrvs::ASSIGNING_CLONES) {
7070
return;
7171
}
@@ -203,12 +203,7 @@ fn is_ok_to_suggest<'tcx>(cx: &LateContext<'tcx>, lhs: &Expr<'tcx>, call: &CallC
203203
implemented_fns.contains_key(&provided_fn.def_id)
204204
}
205205

206-
fn suggest<'tcx>(
207-
cx: &LateContext<'tcx>,
208-
assign_expr: &hir::Expr<'tcx>,
209-
lhs: &hir::Expr<'tcx>,
210-
call: &CallCandidate<'tcx>,
211-
) {
206+
fn suggest<'tcx>(cx: &LateContext<'tcx>, assign_expr: &Expr<'tcx>, lhs: &Expr<'tcx>, call: &CallCandidate<'tcx>) {
212207
span_lint_and_then(cx, ASSIGNING_CLONES, assign_expr.span, call.message(), |diag| {
213208
let mut applicability = Applicability::MachineApplicable;
214209

@@ -261,7 +256,7 @@ impl<'tcx> CallCandidate<'tcx> {
261256
fn suggested_replacement(
262257
&self,
263258
cx: &LateContext<'tcx>,
264-
lhs: &hir::Expr<'tcx>,
259+
lhs: &Expr<'tcx>,
265260
applicability: &mut Applicability,
266261
) -> String {
267262
match self.target {

clippy_lints/src/booleans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,13 +392,13 @@ fn simple_negate(b: Bool) -> Bool {
392392
t @ Term(_) => Not(Box::new(t)),
393393
And(mut v) => {
394394
for el in &mut v {
395-
*el = simple_negate(::std::mem::replace(el, True));
395+
*el = simple_negate(std::mem::replace(el, True));
396396
}
397397
Or(v)
398398
},
399399
Or(mut v) => {
400400
for el in &mut v {
401-
*el = simple_negate(::std::mem::replace(el, True));
401+
*el = simple_negate(std::mem::replace(el, True));
402402
}
403403
And(v)
404404
},

clippy_lints/src/box_default.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn is_local_vec_expn(cx: &LateContext<'_>, expr: &Expr<'_>, ref_expr: &Expr<'_>)
127127
struct InferVisitor(bool);
128128

129129
impl<'tcx> Visitor<'tcx> for InferVisitor {
130-
fn visit_ty(&mut self, t: &rustc_hir::Ty<'_>) {
130+
fn visit_ty(&mut self, t: &Ty<'_>) {
131131
self.0 |= matches!(t.kind, TyKind::Infer | TyKind::OpaqueDef(..) | TyKind::TraitObject(..));
132132
if !self.0 {
133133
walk_ty(self, t);

clippy_lints/src/collection_is_never_read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<'tcx> LateLintPass<'tcx> for CollectionIsNeverRead {
7070
}
7171
}
7272

73-
fn match_acceptable_type(cx: &LateContext<'_>, local: &Local<'_>, collections: &[rustc_span::Symbol]) -> bool {
73+
fn match_acceptable_type(cx: &LateContext<'_>, local: &Local<'_>, collections: &[Symbol]) -> bool {
7474
let ty = cx.typeck_results().pat_ty(local.pat);
7575
collections.iter().any(|&sym| is_type_diagnostic_item(cx, ty, sym))
7676
// String type is a lang item but not a diagnostic item for now so we need a separate check

clippy_lints/src/default_constructed_unit_structs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn is_alias(ty: hir::Ty<'_>) -> bool {
5656

5757
impl LateLintPass<'_> for DefaultConstructedUnitStructs {
5858
fn check_expr<'tcx>(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) {
59-
if let hir::ExprKind::Call(fn_expr, &[]) = expr.kind
59+
if let ExprKind::Call(fn_expr, &[]) = expr.kind
6060
// make sure we have a call to `Default::default`
6161
&& let ExprKind::Path(ref qpath @ hir::QPath::TypeRelative(base, _)) = fn_expr.kind
6262
// make sure this isn't a type alias:

clippy_lints/src/default_instead_of_iter_empty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<'tcx> LateLintPass<'tcx> for DefaultIterEmpty {
6060

6161
fn make_sugg(
6262
cx: &LateContext<'_>,
63-
ty_path: &rustc_hir::QPath<'_>,
63+
ty_path: &QPath<'_>,
6464
ctxt: SyntaxContext,
6565
applicability: &mut Applicability,
6666
path: &str,

clippy_lints/src/derivable_impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn is_path_self(e: &Expr<'_>) -> bool {
7979
fn contains_trait_object(ty: Ty<'_>) -> bool {
8080
match ty.kind() {
8181
ty::Ref(_, ty, _) => contains_trait_object(*ty),
82-
ty::Adt(def, args) => def.is_box() && args[0].as_type().map_or(false, contains_trait_object),
82+
Adt(def, args) => def.is_box() && args[0].as_type().map_or(false, contains_trait_object),
8383
ty::Dynamic(..) => true,
8484
_ => false,
8585
}

clippy_lints/src/escape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
178178
}
179179
}
180180

181-
fn fake_read(&mut self, _: &rustc_hir_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
181+
fn fake_read(&mut self, _: &PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
182182
}
183183

184184
impl<'a, 'tcx> EscapeDelegate<'a, 'tcx> {

clippy_lints/src/eta_reduction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use clippy_utils::higher::VecArgs;
33
use clippy_utils::source::snippet_opt;
44
use clippy_utils::ty::type_diagnostic_name;
55
use clippy_utils::usage::{local_used_after_expr, local_used_in};
6-
use clippy_utils::{get_path_from_caller_to_method_type, higher, is_adjusted, path_to_local, path_to_local_id};
6+
use clippy_utils::{get_path_from_caller_to_method_type, is_adjusted, path_to_local, path_to_local_id};
77
use rustc_errors::Applicability;
88
use rustc_hir::{BindingAnnotation, Expr, ExprKind, FnRetTy, Param, PatKind, QPath, TyKind, Unsafety};
99
use rustc_infer::infer::TyCtxtInferExt;
@@ -88,7 +88,7 @@ impl<'tcx> LateLintPass<'tcx> for EtaReduction {
8888

8989
if body.value.span.from_expansion() {
9090
if body.params.is_empty() {
91-
if let Some(VecArgs::Vec(&[])) = higher::VecArgs::hir(cx, body.value) {
91+
if let Some(VecArgs::Vec(&[])) = VecArgs::hir(cx, body.value) {
9292
// replace `|| vec![]` with `Vec::new`
9393
span_lint_and_sugg(
9494
cx,

clippy_lints/src/floating_point_arithmetic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,9 @@ fn is_testing_negative(cx: &LateContext<'_>, expr: &Expr<'_>, test: &Expr<'_>) -
552552
/// Returns true iff expr is some zero literal
553553
fn is_zero(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
554554
match constant_simple(cx, cx.typeck_results(), expr) {
555-
Some(Constant::Int(i)) => i == 0,
556-
Some(Constant::F32(f)) => f == 0.0,
557-
Some(Constant::F64(f)) => f == 0.0,
555+
Some(Int(i)) => i == 0,
556+
Some(F32(f)) => f == 0.0,
557+
Some(F64(f)) => f == 0.0,
558558
_ => false,
559559
}
560560
}

clippy_lints/src/functions/result.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc_errors::Diag;
22
use rustc_hir as hir;
33
use rustc_lint::{LateContext, LintContext};
44
use rustc_middle::lint::in_external_macro;
5-
use rustc_middle::ty::{self, Adt, Ty};
5+
use rustc_middle::ty::{Adt, Ty};
66
use rustc_span::{sym, Span};
77

88
use clippy_utils::diagnostics::{span_lint_and_help, span_lint_and_then};
@@ -25,7 +25,7 @@ fn result_err_ty<'tcx>(
2525
.tcx
2626
.instantiate_bound_regions_with_erased(cx.tcx.fn_sig(id).instantiate_identity().output())
2727
&& is_type_diagnostic_item(cx, ty, sym::Result)
28-
&& let ty::Adt(_, args) = ty.kind()
28+
&& let Adt(_, args) = ty.kind()
2929
{
3030
let err_ty = args.type_at(1);
3131
Some((hir_ty, err_ty))

clippy_lints/src/implied_bounds_in_impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn emit_lint(
5656
index: usize,
5757
// The bindings that were implied, used for suggestion purposes since removing a bound with associated types
5858
// means we might need to then move it to a different bound
59-
implied_bindings: &[rustc_hir::TypeBinding<'_>],
59+
implied_bindings: &[TypeBinding<'_>],
6060
bound: &ImplTraitBound<'_>,
6161
) {
6262
let implied_by = snippet(cx, bound.span, "..");

clippy_lints/src/instant_subtraction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use clippy_config::msrvs::{self, Msrv};
2-
use clippy_utils::diagnostics::{self, span_lint_and_sugg};
2+
use clippy_utils::diagnostics::span_lint_and_sugg;
33
use clippy_utils::source::snippet_with_context;
44
use clippy_utils::sugg::Sugg;
55
use clippy_utils::ty;
@@ -149,7 +149,7 @@ fn print_unchecked_duration_subtraction_sugg(
149149
let left_expr = snippet_with_context(cx, left_expr.span, ctxt, "<instant>", &mut applicability).0;
150150
let right_expr = snippet_with_context(cx, right_expr.span, ctxt, "<duration>", &mut applicability).0;
151151

152-
diagnostics::span_lint_and_sugg(
152+
span_lint_and_sugg(
153153
cx,
154154
UNCHECKED_DURATION_SUBTRACTION,
155155
expr.span,

clippy_lints/src/invalid_upcast_comparisons.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ fn err_upcast_comparison(cx: &LateContext<'_>, span: Span, expr: &Expr<'_>, alwa
8888
fn upcast_comparison_bounds_err<'tcx>(
8989
cx: &LateContext<'tcx>,
9090
span: Span,
91-
rel: comparisons::Rel,
91+
rel: Rel,
9292
lhs_bounds: Option<(FullInt, FullInt)>,
9393
lhs: &'tcx Expr<'_>,
9494
rhs: &'tcx Expr<'_>,

clippy_lints/src/len_zero.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ fn check_trait_items(cx: &LateContext<'_>, visited_trait: &Item<'_>, trait_items
256256
.items()
257257
.flat_map(|&i| cx.tcx.associated_items(i).filter_by_name_unhygienic(is_empty))
258258
.any(|i| {
259-
i.kind == ty::AssocKind::Fn
259+
i.kind == AssocKind::Fn
260260
&& i.fn_has_self_parameter
261261
&& cx.tcx.fn_sig(i.def_id).skip_binder().inputs().skip_binder().len() == 1
262262
});
@@ -594,7 +594,7 @@ fn is_empty_array(expr: &Expr<'_>) -> bool {
594594
fn has_is_empty(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
595595
/// Gets an `AssocItem` and return true if it matches `is_empty(self)`.
596596
fn is_is_empty(cx: &LateContext<'_>, item: &ty::AssocItem) -> bool {
597-
if item.kind == ty::AssocKind::Fn {
597+
if item.kind == AssocKind::Fn {
598598
let sig = cx.tcx.fn_sig(item.def_id).skip_binder();
599599
let ty = sig.skip_binder();
600600
ty.inputs().len() == 1

clippy_lints/src/lib.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
rustc::diagnostic_outside_of_impl,
1717
rustc::untranslatable_diagnostic
1818
)]
19-
#![warn(trivial_casts, trivial_numeric_casts)]
20-
// warn on lints, that are included in `rust-lang/rust`s bootstrap
21-
#![warn(rust_2018_idioms, unused_lifetimes)]
22-
// warn on rustc internal lints
23-
#![warn(rustc::internal)]
19+
#![warn(
20+
trivial_casts,
21+
trivial_numeric_casts,
22+
rust_2018_idioms,
23+
unused_lifetimes,
24+
unused_qualifications,
25+
rustc::internal
26+
)]
2427
// Disable this rustc lint for now, as it was also done in rustc
2528
#![allow(rustc::potential_query_instability)]
2629

clippy_lints/src/literal_representation.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ enum WarningType {
158158
}
159159

160160
impl WarningType {
161-
fn display(&self, suggested_format: String, cx: &EarlyContext<'_>, span: rustc_span::Span) {
161+
fn display(&self, suggested_format: String, cx: &EarlyContext<'_>, span: Span) {
162162
match self {
163163
Self::MistypedLiteralSuffix => span_lint_and_sugg(
164164
cx,
@@ -302,11 +302,7 @@ impl LiteralDigitGrouping {
302302
}
303303

304304
// Returns `false` if the check fails
305-
fn check_for_mistyped_suffix(
306-
cx: &EarlyContext<'_>,
307-
span: rustc_span::Span,
308-
num_lit: &mut NumericLiteral<'_>,
309-
) -> bool {
305+
fn check_for_mistyped_suffix(cx: &EarlyContext<'_>, span: Span, num_lit: &mut NumericLiteral<'_>) -> bool {
310306
if num_lit.suffix.is_some() {
311307
return true;
312308
}

clippy_lints/src/loops/mut_range_bound.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl<'tcx> Delegate<'tcx> for MutatePairDelegate<'_, 'tcx> {
109109
}
110110
}
111111

112-
fn fake_read(&mut self, _: &rustc_hir_typeck::expr_use_visitor::PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
112+
fn fake_read(&mut self, _: &PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {}
113113
}
114114

115115
impl MutatePairDelegate<'_, '_> {
@@ -141,7 +141,7 @@ impl BreakAfterExprVisitor {
141141
}
142142
}
143143

144-
impl<'tcx> intravisit::Visitor<'tcx> for BreakAfterExprVisitor {
144+
impl<'tcx> Visitor<'tcx> for BreakAfterExprVisitor {
145145
fn visit_expr(&mut self, expr: &'tcx Expr<'tcx>) {
146146
if self.past_candidate {
147147
return;

clippy_lints/src/loops/needless_range_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
357357
let def_id = self.cx.typeck_results().type_dependent_def_id(expr.hir_id).unwrap();
358358
for (ty, expr) in iter::zip(
359359
self.cx.tcx.fn_sig(def_id).instantiate_identity().inputs().skip_binder(),
360-
std::iter::once(receiver).chain(args.iter()),
360+
iter::once(receiver).chain(args.iter()),
361361
) {
362362
self.prefer_mutable = false;
363363
if let ty::Ref(_, _, mutbl) = *ty.kind() {

clippy_lints/src/loops/never_loop.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,9 @@ fn never_loop_expr<'tcx>(
159159
| ExprKind::DropTemps(e) => never_loop_expr(cx, e, local_labels, main_loop_id),
160160
ExprKind::Let(let_expr) => never_loop_expr(cx, let_expr.init, local_labels, main_loop_id),
161161
ExprKind::Array(es) | ExprKind::Tup(es) => never_loop_expr_all(cx, es.iter(), local_labels, main_loop_id),
162-
ExprKind::MethodCall(_, receiver, es, _) => never_loop_expr_all(
163-
cx,
164-
std::iter::once(receiver).chain(es.iter()),
165-
local_labels,
166-
main_loop_id,
167-
),
162+
ExprKind::MethodCall(_, receiver, es, _) => {
163+
never_loop_expr_all(cx, once(receiver).chain(es.iter()), local_labels, main_loop_id)
164+
},
168165
ExprKind::Struct(_, fields, base) => {
169166
let fields = never_loop_expr_all(cx, fields.iter().map(|f| f.expr), local_labels, main_loop_id);
170167
if let Some(base) = base {

clippy_lints/src/loops/single_element_loop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub(super) fn check<'tcx>(
4242
},
4343
[],
4444
_,
45-
) if method.ident.name == rustc_span::sym::iter => (arg, "&"),
45+
) if method.ident.name == sym::iter => (arg, "&"),
4646
ExprKind::MethodCall(
4747
method,
4848
Expr {
@@ -60,7 +60,7 @@ pub(super) fn check<'tcx>(
6060
},
6161
[],
6262
_,
63-
) if method.ident.name == rustc_span::sym::into_iter => (arg, ""),
63+
) if method.ident.name == sym::into_iter => (arg, ""),
6464
// Only check for arrays edition 2021 or later, as this case will trigger a compiler error otherwise.
6565
ExprKind::Array([arg]) if cx.tcx.sess.edition() >= Edition::Edition2021 => (arg, ""),
6666
_ => return,

clippy_lints/src/manual_bits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn is_ty_conversion(expr: &Expr<'_>) -> bool {
139139
if let ExprKind::Cast(..) = expr.kind {
140140
true
141141
} else if let ExprKind::MethodCall(path, _, [], _) = expr.kind
142-
&& path.ident.name == rustc_span::sym::try_into
142+
&& path.ident.name == sym::try_into
143143
{
144144
// This is only called for `usize` which implements `TryInto`. Therefore,
145145
// we don't have to check here if `self` implements the `TryInto` trait.

clippy_lints/src/methods/clear_with_drain.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use clippy_utils::diagnostics::span_lint_and_sugg;
22
use clippy_utils::is_range_full;
33
use clippy_utils::ty::{is_type_diagnostic_item, is_type_lang_item};
44
use rustc_errors::Applicability;
5-
use rustc_hir as hir;
65
use rustc_hir::{Expr, ExprKind, LangItem, QPath};
76
use rustc_lint::LateContext;
87
use rustc_span::symbol::sym;
@@ -28,7 +27,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, recv: &Expr<'_>, span
2827
}
2928
}
3029

31-
fn match_acceptable_type(cx: &LateContext<'_>, expr: &hir::Expr<'_>, types: &[rustc_span::Symbol]) -> bool {
30+
fn match_acceptable_type(cx: &LateContext<'_>, expr: &Expr<'_>, types: &[rustc_span::Symbol]) -> bool {
3231
let expr_ty = cx.typeck_results().expr_ty(expr).peel_refs();
3332
types.iter().any(|&ty| is_type_diagnostic_item(cx, expr_ty, ty))
3433
// String type is a lang item but not a diagnostic item for now so we need a separate check

0 commit comments

Comments
 (0)