Skip to content

Commit 6384221

Browse files
committed
Dogfood
1 parent 2be695b commit 6384221

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clippy_lints/src/significant_drop_tightening.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clippy_utils::{
22
diagnostics::span_lint_and_then,
3-
expr_or_init, get_attr, match_def_path, path_to_local, paths,
3+
expr_or_init, get_attr, path_to_local,
44
source::{indent_of, snippet},
55
};
66
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
@@ -13,6 +13,7 @@ use rustc_hir::{
1313
use rustc_lint::{LateContext, LateLintPass, LintContext};
1414
use rustc_middle::ty::{subst::GenericArgKind, Ty, TypeAndMut};
1515
use rustc_session::{declare_tool_lint, impl_lint_pass};
16+
use rustc_span::sym;
1617
use rustc_span::{symbol::Ident, Span, DUMMY_SP};
1718
use std::borrow::Cow;
1819

@@ -435,7 +436,7 @@ fn has_drop(expr: &hir::Expr<'_>, first_bind_ident: &Ident, lcx: &LateContext<'_
435436
if let hir::ExprKind::Call(fun, args) = expr.kind
436437
&& let hir::ExprKind::Path(hir::QPath::Resolved(_, fun_path)) = &fun.kind
437438
&& let Res::Def(DefKind::Fn, did) = fun_path.res
438-
&& match_def_path(lcx, did, &paths::DROP)
439+
&& lcx.tcx.is_diagnostic_item(sym::mem_drop, did)
439440
&& let [first_arg, ..] = args
440441
&& let hir::ExprKind::Path(hir::QPath::Resolved(_, arg_path)) = &first_arg.kind
441442
&& let [first_arg_ps, .. ] = arg_path.segments

clippy_utils/src/paths.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ pub const LATE_CONTEXT: [&str; 2] = ["rustc_lint", "LateContext"];
5757
pub const LATE_LINT_PASS: [&str; 3] = ["rustc_lint", "passes", "LateLintPass"];
5858
#[cfg(feature = "internal")]
5959
pub const LINT: [&str; 2] = ["rustc_lint_defs", "Lint"];
60-
pub const DROP: [&str; 3] = ["core", "mem", "drop"];
6160
pub const MEM_SWAP: [&str; 3] = ["core", "mem", "swap"];
6261
#[cfg(feature = "internal")]
6362
pub const MSRV: [&str; 3] = ["clippy_utils", "msrvs", "Msrv"];

0 commit comments

Comments
 (0)