use if_chain::if_chain;
use rustc_errors::Applicability;
use rustc_hir::def_id::DefId;
-use rustc_hir::{Expr, ExprKind, Param, PatKind, Unsafety};
+use rustc_hir::{Closure, Expr, ExprKind, Param, PatKind, Unsafety};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::ty::adjustment::{Adjust, Adjustment, AutoBorrow};
use rustc_middle::ty::binding::BindingMode;
return;
}
let body = match expr.kind {
- ExprKind::Closure { body, .. } => cx.tcx.hir().body(body),
+ ExprKind::Closure(&Closure { body, .. }) => cx.tcx.hir().body(body),
_ => return,
};
if body.value.span.from_expansion() {