Skip to content

Commit 70ebfbb

Browse files
authored
Rollup merge of rust-lang#134265 - compiler-errors:ty_def_id, r=oli-obk
Rename `ty_def_id` so people will stop using it by accident This function is just for cycle detection, but people keep using it because they think it's the right way of getting the def id from a `Ty` (and I can't blame them necessarily).
2 parents 695f938 + f3a8d4c commit 70ebfbb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

clippy_lints/src/methods/unnecessary_filter_map.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ use clippy_utils::diagnostics::span_lint_and_sugg;
33
use clippy_utils::ty::is_copy;
44
use clippy_utils::usage::mutated_variables;
55
use clippy_utils::visitors::{Descend, for_each_expr_without_closures};
6-
use clippy_utils::{MaybePath, is_res_lang_ctor, is_trait_method, path_res, path_to_local_id};
6+
use clippy_utils::{is_res_lang_ctor, is_trait_method, path_res, path_to_local_id};
77
use core::ops::ControlFlow;
88
use rustc_errors::Applicability;
99
use rustc_hir as hir;
1010
use rustc_hir::LangItem::{OptionNone, OptionSome};
1111
use rustc_lint::LateContext;
12-
use rustc_middle::query::Key;
1312
use rustc_middle::ty;
1413
use rustc_span::sym;
1514

@@ -44,7 +43,6 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>, a
4443
if name == "filter_map"
4544
&& let hir::ExprKind::Call(expr, args) = body.value.kind
4645
&& is_res_lang_ctor(cx, path_res(cx, expr), OptionSome)
47-
&& arg_id.ty_def_id() == args[0].hir_id().ty_def_id()
4846
&& let hir::ExprKind::Path(_) = args[0].kind
4947
{
5048
span_lint_and_sugg(

0 commit comments

Comments
 (0)