Skip to content

Commit 37f79d5

Browse files
committed
Auto merge of rust-lang#134294 - matthiaskrgr:rollup-anh6io8, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#134252 (Fix `Path::is_absolute` on Hermit) - rust-lang#134254 (Fix building `std` for Hermit after `c_char` change) - rust-lang#134255 (Update includes in `/library/core/src/error.rs`.) - rust-lang#134261 (Document the symbol Visibility enum) - rust-lang#134262 (Arbitrary self types v2: adjust diagnostic.) - rust-lang#134265 (Rename `ty_def_id` so people will stop using it by accident) - rust-lang#134271 (Arbitrary self types v2: better feature gate test) - rust-lang#134274 (Add check-pass test for `&raw`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 503f2bc + 70ebfbb commit 37f79d5

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)