diff options
| author | bors <bors@rust-lang.org> | 2024-12-14 06:44:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-12-14 06:44:05 +0000 |
| commit | 37f79d5a85fe2ebe11be3e2c711fe635383e2ebc (patch) | |
| tree | d24a1b7323fe59da7834b8805d04dcc32a9e69ff | |
| parent | 503f2bc3aaa4886188e8a5fdd4a0b0bf68b42e69 (diff) | |
| parent | 70ebfbb26f9ace0a11deab928d6a97dd5eaf9cb4 (diff) | |
| download | rust-37f79d5a85fe2ebe11be3e2c711fe635383e2ebc.tar.gz rust-37f79d5a85fe2ebe11be3e2c711fe635383e2ebc.zip | |
Auto merge of #134294 - matthiaskrgr:rollup-anh6io8, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #134252 (Fix `Path::is_absolute` on Hermit) - #134254 (Fix building `std` for Hermit after `c_char` change) - #134255 (Update includes in `/library/core/src/error.rs`.) - #134261 (Document the symbol Visibility enum) - #134262 (Arbitrary self types v2: adjust diagnostic.) - #134265 (Rename `ty_def_id` so people will stop using it by accident) - #134271 (Arbitrary self types v2: better feature gate test) - #134274 (Add check-pass test for `&raw`) r? `@ghost` `@rustbot` modify labels: rollup
| -rw-r--r-- | clippy_lints/src/methods/unnecessary_filter_map.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clippy_lints/src/methods/unnecessary_filter_map.rs b/clippy_lints/src/methods/unnecessary_filter_map.rs index 3de51bc661e..5b9e9e70e47 100644 --- a/clippy_lints/src/methods/unnecessary_filter_map.rs +++ b/clippy_lints/src/methods/unnecessary_filter_map.rs @@ -3,13 +3,12 @@ use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::ty::is_copy; use clippy_utils::usage::mutated_variables; use clippy_utils::visitors::{Descend, for_each_expr_without_closures}; -use clippy_utils::{MaybePath, is_res_lang_ctor, is_trait_method, path_res, path_to_local_id}; +use clippy_utils::{is_res_lang_ctor, is_trait_method, path_res, path_to_local_id}; use core::ops::ControlFlow; use rustc_errors::Applicability; use rustc_hir as hir; use rustc_hir::LangItem::{OptionNone, OptionSome}; use rustc_lint::LateContext; -use rustc_middle::query::Key; use rustc_middle::ty; use rustc_span::sym; @@ -44,7 +43,6 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>, a if name == "filter_map" && let hir::ExprKind::Call(expr, args) = body.value.kind && is_res_lang_ctor(cx, path_res(cx, expr), OptionSome) - && arg_id.ty_def_id() == args[0].hir_id().ty_def_id() && let hir::ExprKind::Path(_) = args[0].kind { span_lint_and_sugg( |
