Skip to content

Commit

Permalink
Auto merge of #13630 - samueltardieu:push-qrnxuykslnsl, r=y21
Browse files Browse the repository at this point in the history
Use match ergonomics compatible with editions 2021 and 2024

This PR contains the minimal changes needed to make Clippy match ergonomics work with both Rust 2021 and Rust 2024.

changelog: none
  • Loading branch information
bors committed Nov 1, 2024
2 parents 9d03956 + 0c1ef98 commit e8b78e2
Show file tree
Hide file tree
Showing 33 changed files with 66 additions and 69 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/checked_conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ fn get_types_from_cast<'a>(
// or `to_type::MAX as from_type`
let call_from_cast: Option<(&Expr<'_>, &str)> = if let ExprKind::Cast(limit, from_type) = &expr.kind
// to_type::max_value(), from_type
&& let TyKind::Path(ref from_type_path) = &from_type.kind
&& let TyKind::Path(from_type_path) = &from_type.kind
&& let Some(from_sym) = int_ty_to_sym(from_type_path)
{
Some((limit, from_sym))
Expand All @@ -245,7 +245,7 @@ fn get_types_from_cast<'a>(
if let ExprKind::Call(from_func, [limit]) = &expr.kind
// `from_type::from, to_type::max_value()`
// `from_type::from`
&& let ExprKind::Path(ref path) = &from_func.kind
&& let ExprKind::Path(path) = &from_func.kind
&& let Some(from_sym) = get_implementing_type(path, INTS, "from")
{
Some((limit, from_sym))
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/copy_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ declare_lint_pass!(CopyIterator => [COPY_ITERATOR]);
impl<'tcx> LateLintPass<'tcx> for CopyIterator {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
if let ItemKind::Impl(Impl {
of_trait: Some(ref trait_ref),
of_trait: Some(trait_ref),
..
}) = item.kind
&& let ty = cx.tcx.type_of(item.owner_id).instantiate_identity()
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/derivable_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ fn check_enum<'tcx>(cx: &LateContext<'tcx>, item: &'tcx Item<'_>, func_expr: &Ex
impl<'tcx> LateLintPass<'tcx> for DerivableImpls {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
if let ItemKind::Impl(Impl {
of_trait: Some(ref trait_ref),
of_trait: Some(trait_ref),
items: [child],
self_ty,
..
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ declare_lint_pass!(Derive => [
impl<'tcx> LateLintPass<'tcx> for Derive {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
if let ItemKind::Impl(Impl {
of_trait: Some(ref trait_ref),
of_trait: Some(trait_ref),
..
}) = item.kind
{
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/disallowed_script_idents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl EarlyLintPass for DisallowedScriptIdents {
let mut symbols: Vec<_> = symbols.iter().collect();
symbols.sort_unstable_by_key(|k| k.1);

for (symbol, &span) in &symbols {
for &(symbol, &span) in &symbols {
// Note: `symbol.as_str()` is an expensive operation, thus should not be called
// more than once for a single symbol.
let symbol_str = symbol.as_str();
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/empty_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ declare_lint_pass!(EmptyDrop => [EMPTY_DROP]);
impl LateLintPass<'_> for EmptyDrop {
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
if let ItemKind::Impl(Impl {
of_trait: Some(ref trait_ref),
of_trait: Some(trait_ref),
items: [child],
..
}) = item.kind
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/len_zero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ fn has_is_empty(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
.filter_by_name_unhygienic(is_empty)
.any(|item| is_is_empty(cx, item))
}),
ty::Alias(ty::Projection, ref proj) => has_is_empty_impl(cx, proj.def_id),
ty::Alias(ty::Projection, proj) => has_is_empty_impl(cx, proj.def_id),
ty::Adt(id, _) => has_is_empty_impl(cx, id.did()),
ty::Array(..) | ty::Slice(..) | ty::Str => true,
_ => false,
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ impl<'tcx> Visitor<'tcx> for RefVisitor<'_, 'tcx> {
self.visit_opaque_ty(opaque);
self.lts.truncate(len);
self.lts.extend(bounds.iter().filter_map(|bound| match bound {
GenericArg::Lifetime(&l) => Some(l),
&GenericArg::Lifetime(l) => Some(l),
_ => None,
}));
},
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/manual_async_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ fn captures_all_lifetimes(inputs: &[Ty<'_>], output_lifetimes: &[LifetimeName])
}

fn desugared_async_block<'tcx>(cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) -> Option<&'tcx Body<'tcx>> {
if let Some(Expr {
if let Some(&Expr {
kind: ExprKind::Closure(&Closure { kind, body, .. }),
..
}) = block.expr
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/matches/match_like_matches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ fn find_bool_lit(ex: &ExprKind<'_>) -> Option<bool> {
}) => Some(*b),
ExprKind::Block(
rustc_hir::Block {
stmts: &[],
stmts: [],
expr: Some(exp),
..
},
Expand Down
15 changes: 7 additions & 8 deletions clippy_lints/src/matches/redundant_pattern_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,9 @@ fn found_good_method<'tcx>(
node: (&PatKind<'_>, &PatKind<'_>),
) -> Option<(&'static str, Option<&'tcx Expr<'tcx>>)> {
match node {
(
PatKind::TupleStruct(ref path_left, patterns_left, _),
PatKind::TupleStruct(ref path_right, patterns_right, _),
) if patterns_left.len() == 1 && patterns_right.len() == 1 => {
(PatKind::TupleStruct(path_left, patterns_left, _), PatKind::TupleStruct(path_right, patterns_right, _))
if patterns_left.len() == 1 && patterns_right.len() == 1 =>
{
if let (PatKind::Wild, PatKind::Wild) = (&patterns_left[0].kind, &patterns_right[0].kind) {
find_good_method_for_match(
cx,
Expand Down Expand Up @@ -350,8 +349,8 @@ fn found_good_method<'tcx>(
None
}
},
(PatKind::TupleStruct(ref path_left, patterns, _), PatKind::Path(ref path_right))
| (PatKind::Path(ref path_left), PatKind::TupleStruct(ref path_right, patterns, _))
(PatKind::TupleStruct(path_left, patterns, _), PatKind::Path(path_right))
| (PatKind::Path(path_left), PatKind::TupleStruct(path_right, patterns, _))
if patterns.len() == 1 =>
{
if let PatKind::Wild = patterns[0].kind {
Expand Down Expand Up @@ -381,14 +380,14 @@ fn found_good_method<'tcx>(
None
}
},
(PatKind::TupleStruct(ref path_left, patterns, _), PatKind::Wild) if patterns.len() == 1 => {
(PatKind::TupleStruct(path_left, patterns, _), PatKind::Wild) if patterns.len() == 1 => {
if let PatKind::Wild = patterns[0].kind {
get_good_method(cx, arms, path_left)
} else {
None
}
},
(PatKind::Path(ref path_left), PatKind::Wild) => get_good_method(cx, arms, path_left),
(PatKind::Path(path_left), PatKind::Wild) => get_good_method(cx, arms, path_left),
_ => None,
}
}
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/methods/filter_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ fn is_method(cx: &LateContext<'_>, expr: &Expr<'_>, method_name: Symbol) -> bool
ExprKind::Path(QPath::TypeRelative(_, mname)) => mname.ident.name == method_name,
ExprKind::Path(QPath::Resolved(_, segments)) => segments.segments.last().unwrap().ident.name == method_name,
ExprKind::MethodCall(segment, _, _, _) => segment.ident.name == method_name,
ExprKind::Closure(&Closure { body, .. }) => {
let body = cx.tcx.hir().body(body);
ExprKind::Closure(Closure { body, .. }) => {
let body = cx.tcx.hir().body(*body);
let closure_expr = peel_blocks(body.value);
match closure_expr.kind {
ExprKind::MethodCall(PathSegment { ident, .. }, receiver, ..) => {
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/needless_late_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessLateInit {
if let LetStmt {
init: None,
pat:
&Pat {
Pat {
kind: PatKind::Binding(BindingMode::NONE, binding_id, _, None),
..
},
Expand All @@ -357,7 +357,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessLateInit {
&& let Some((_, Node::Stmt(local_stmt))) = parents.next()
&& let Some((_, Node::Block(block))) = parents.next()
{
check(cx, local, local_stmt, block, binding_id);
check(cx, local, local_stmt, block, *binding_id);
}
}
}
2 changes: 1 addition & 1 deletion clippy_lints/src/needless_pass_by_ref_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByRefMut<'tcx> {
.iter()
.zip(fn_sig.inputs())
.zip(body.params)
.filter(|((&input, &ty), arg)| !should_skip(cx, input, ty, arg))
.filter(|&((&input, &ty), arg)| !should_skip(cx, input, ty, arg))
.peekable();
if it.peek().is_none() {
return;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/partialeq_ne_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ declare_lint_pass!(PartialEqNeImpl => [PARTIALEQ_NE_IMPL]);
impl<'tcx> LateLintPass<'tcx> for PartialEqNeImpl {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
if let ItemKind::Impl(Impl {
of_trait: Some(ref trait_ref),
of_trait: Some(trait_ref),
items: impl_items,
..
}) = item.kind
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/question_mark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ enum IfBlockType<'hir> {

fn find_let_else_ret_expression<'hir>(block: &'hir Block<'hir>) -> Option<&'hir Expr<'hir>> {
if let Block {
stmts: &[],
stmts: [],
expr: Some(els),
..
} = block
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/ref_option_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl<'tcx> LateLintPass<'tcx> for RefOptionRef {
fn check_ty(&mut self, cx: &LateContext<'tcx>, ty: &'tcx Ty<'tcx>) {
if let TyKind::Ref(_, ref mut_ty) = ty.kind
&& mut_ty.mutbl == Mutability::Not
&& let TyKind::Path(ref qpath) = &mut_ty.ty.kind
&& let TyKind::Path(qpath) = &mut_ty.ty.kind
&& let last = last_path_segment(qpath)
&& let Some(def_id) = last.res.opt_def_id()
&& cx.tcx.is_diagnostic_item(sym::Option, def_id)
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/returns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ fn check_final_expr<'tcx>(
let peeled_drop_expr = expr.peel_drop_temps();
match &peeled_drop_expr.kind {
// simple return is always "bad"
ExprKind::Ret(ref inner) => {
ExprKind::Ret(inner) => {
// check if expr return nothing
let ret_span = if inner.is_none() && replacement == RetReplacement::Empty {
extend_span_to_previous_non_ws(cx, peeled_drop_expr.span)
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/serde_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare_lint_pass!(SerdeApi => [SERDE_API_MISUSE]);
impl<'tcx> LateLintPass<'tcx> for SerdeApi {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
if let ItemKind::Impl(Impl {
of_trait: Some(ref trait_ref),
of_trait: Some(trait_ref),
items,
..
}) = item.kind
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/single_component_path_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl SingleComponentPathImports {
}

match &item.kind {
ItemKind::Mod(_, ModKind::Loaded(ref items, ..)) => {
ItemKind::Mod(_, ModKind::Loaded(items, ..)) => {
self.check_mod(items);
},
ItemKind::MacroDef(MacroDef { macro_rules: true, .. }) => {
Expand Down
28 changes: 13 additions & 15 deletions clippy_lints/src/suspicious_operation_groupings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ fn strip_non_ident_wrappers(expr: &Expr) -> &Expr {
let mut output = expr;
loop {
output = match &output.kind {
ExprKind::Paren(ref inner) | ExprKind::Unary(_, ref inner) => inner,
ExprKind::Paren(inner) | ExprKind::Unary(_, inner) => inner,
_ => {
return output;
},
Expand All @@ -348,13 +348,13 @@ fn extract_related_binops(kind: &ExprKind) -> Option<Vec<BinaryOp<'_>>> {

fn if_statement_binops(kind: &ExprKind) -> Option<Vec<BinaryOp<'_>>> {
match kind {
ExprKind::If(ref condition, _, _) => chained_binops(&condition.kind),
ExprKind::Paren(ref e) => if_statement_binops(&e.kind),
ExprKind::Block(ref block, _) => {
ExprKind::If(condition, _, _) => chained_binops(&condition.kind),
ExprKind::Paren(e) => if_statement_binops(&e.kind),
ExprKind::Block(block, _) => {
let mut output = None;
for stmt in &block.stmts {
match stmt.kind {
StmtKind::Expr(ref e) | StmtKind::Semi(ref e) => {
match &stmt.kind {
StmtKind::Expr(e) | StmtKind::Semi(e) => {
output = append_opt_vecs(output, if_statement_binops(&e.kind));
},
_ => {},
Expand Down Expand Up @@ -383,24 +383,22 @@ fn append_opt_vecs<A>(target_opt: Option<Vec<A>>, source_opt: Option<Vec<A>>) ->
fn chained_binops(kind: &ExprKind) -> Option<Vec<BinaryOp<'_>>> {
match kind {
ExprKind::Binary(_, left_outer, right_outer) => chained_binops_helper(left_outer, right_outer),
ExprKind::Paren(ref e) | ExprKind::Unary(_, ref e) => chained_binops(&e.kind),
ExprKind::Paren(e) | ExprKind::Unary(_, e) => chained_binops(&e.kind),
_ => None,
}
}

fn chained_binops_helper<'expr>(left_outer: &'expr Expr, right_outer: &'expr Expr) -> Option<Vec<BinaryOp<'expr>>> {
match (&left_outer.kind, &right_outer.kind) {
(
ExprKind::Paren(ref left_e) | ExprKind::Unary(_, ref left_e),
ExprKind::Paren(ref right_e) | ExprKind::Unary(_, ref right_e),
ExprKind::Paren(left_e) | ExprKind::Unary(_, left_e),
ExprKind::Paren(right_e) | ExprKind::Unary(_, right_e),
) => chained_binops_helper(left_e, right_e),
(ExprKind::Paren(ref left_e) | ExprKind::Unary(_, ref left_e), _) => chained_binops_helper(left_e, right_outer),
(_, ExprKind::Paren(ref right_e) | ExprKind::Unary(_, ref right_e)) => {
chained_binops_helper(left_outer, right_e)
},
(ExprKind::Paren(left_e) | ExprKind::Unary(_, left_e), _) => chained_binops_helper(left_e, right_outer),
(_, ExprKind::Paren(right_e) | ExprKind::Unary(_, right_e)) => chained_binops_helper(left_outer, right_e),
(
ExprKind::Binary(Spanned { node: left_op, .. }, ref left_left, ref left_right),
ExprKind::Binary(Spanned { node: right_op, .. }, ref right_left, ref right_right),
ExprKind::Binary(Spanned { node: left_op, .. }, left_left, left_right),
ExprKind::Binary(Spanned { node: right_op, .. }, right_left, right_right),
) => match (
chained_binops_helper(left_left, left_right),
chained_binops_helper(right_left, right_right),
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ impl<'tcx> IndexBinding<'_, 'tcx> {
for stmt in self.block.stmts {
match stmt.kind {
StmtKind::Expr(expr) | StmtKind::Semi(expr) => v.visit_expr(expr),
StmtKind::Let(LetStmt { ref init, .. }) => {
StmtKind::Let(LetStmt { init, .. }) => {
if let Some(init) = init.as_ref() {
v.visit_expr(init);
}
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/trait_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
let mut self_bounds_map = FxHashMap::default();

for predicate in item.generics.predicates {
if let WherePredicate::BoundPredicate(ref bound_predicate) = predicate
if let WherePredicate::BoundPredicate(bound_predicate) = predicate
&& bound_predicate.origin != PredicateOrigin::ImplTrait
&& !bound_predicate.span.from_expansion()
&& let TyKind::Path(QPath::Resolved(_, Path { segments, .. })) = bound_predicate.bounded_ty.kind
Expand Down Expand Up @@ -268,7 +268,7 @@ impl TraitBounds {
let mut map: UnhashMap<SpanlessTy<'_, '_>, Vec<&GenericBound<'_>>> = UnhashMap::default();
let mut applicability = Applicability::MaybeIncorrect;
for bound in generics.predicates {
if let WherePredicate::BoundPredicate(ref p) = bound
if let WherePredicate::BoundPredicate(p) = bound
&& p.origin != PredicateOrigin::ImplTrait
&& p.bounds.len() as u64 <= self.max_trait_bounds
&& !p.span.from_expansion()
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/undocumented_unsafe_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ fn expr_has_unnecessary_safety_comment<'tcx>(
if cx.tcx.hir().parent_iter(expr.hir_id).any(|(_, ref node)| {
matches!(
node,
Node::Block(&Block {
Node::Block(Block {
rules: BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided),
..
}),
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/unit_types/let_unit_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ fn needs_inferred_result_ty(
let (id, receiver, args) = match e.kind {
ExprKind::Call(
Expr {
kind: ExprKind::Path(ref path),
kind: ExprKind::Path(path),
hir_id,
..
},
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/unit_types/unit_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ fn is_empty_block(expr: &Expr<'_>) -> bool {
expr.kind,
ExprKind::Block(
Block {
stmts: &[],
stmts: [],
expr: None,
..
},
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/unused_io_amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ fn unpack_call_chain<'a>(mut expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> {
}

fn unpack_try<'a>(mut expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> {
while let ExprKind::Call(func, [ref arg_0]) = expr.kind
while let ExprKind::Call(func, [arg_0]) = expr.kind
&& matches!(
func.kind,
ExprKind::Path(hir::QPath::LangItem(hir::LangItem::TryTraitBranch, ..))
Expand All @@ -266,7 +266,7 @@ fn unpack_match<'a>(mut expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> {
/// waited on. Otherwise return None.
fn unpack_await<'a>(expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> {
if let ExprKind::Match(expr, _, hir::MatchSource::AwaitDesugar) = expr.kind {
if let ExprKind::Call(func, [ref arg_0]) = expr.kind {
if let ExprKind::Call(func, [arg_0]) = expr.kind {
if matches!(
func.kind,
ExprKind::Path(hir::QPath::LangItem(hir::LangItem::IntoFutureIntoFuture, ..))
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
self.pat(field!(let_expr.pat));
// Does what ExprKind::Cast does, only adds a clause for the type
// if it's a path
if let Some(TyKind::Path(ref qpath)) = let_expr.value.ty.as_ref().map(|ty| &ty.kind) {
if let Some(TyKind::Path(qpath)) = let_expr.value.ty.as_ref().map(|ty| &ty.kind) {
bind!(self, qpath);
chain!(self, "let TyKind::Path(ref {qpath}) = {let_expr}.ty.kind");
self.qpath(qpath);
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/internal_lints/collapsible_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<'tcx> LateLintPass<'tcx> for CollapsibleCalls {

if let ExprKind::Call(func, [call_cx, call_lint, call_sp, call_msg, call_f]) = expr.kind
&& is_expr_path_def_path(cx, func, &["clippy_utils", "diagnostics", "span_lint_and_then"])
&& let ExprKind::Closure(&Closure { body, .. }) = &call_f.kind
&& let ExprKind::Closure(&Closure { body, .. }) = call_f.kind
&& let body = cx.tcx.hir().body(body)
&& let only_expr = peel_blocks_with_stmt(body.value)
&& let ExprKind::MethodCall(ps, recv, span_call_args, _) = &only_expr.kind
Expand Down
Loading

0 comments on commit e8b78e2

Please sign in to comment.