Skip to content

Commit f9fcbbe

Browse files
author
Vali Schneider
committed
fixed bug
1 parent 73a3288 commit f9fcbbe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clippy_lints/src/panic_in_result.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@ impl<'tcx> LateLintPass<'tcx> for PanicInResult {
3434
fn check_fn(
3535
&mut self,
3636
cx: &LateContext<'tcx>,
37-
_: FnKind<'tcx>,
37+
fn_kind: FnKind<'tcx>,
3838
_: &'tcx hir::FnDecl<'tcx>,
3939
body: &'tcx hir::Body<'tcx>,
4040
span: Span,
4141
hir_id: hir::HirId,
4242
) {
43+
if let FnKind::Closure(_) = fn_kind {
44+
return;
45+
}
4346
if_chain! {
4447
if is_type_diagnostic_item(cx, return_ty(cx, hir_id), sym!(result_type));
4548
then

0 commit comments

Comments
 (0)