fixed bug

This commit is contained in:
Vali Schneider 2020-08-31 13:32:05 -07:00
parent 73a3288282
commit f9fcbbea03

View file

@ -34,12 +34,15 @@ impl<'tcx> LateLintPass<'tcx> for PanicInResult {
fn check_fn(
&mut self,
cx: &LateContext<'tcx>,
_: FnKind<'tcx>,
fn_kind: FnKind<'tcx>,
_: &'tcx hir::FnDecl<'tcx>,
body: &'tcx hir::Body<'tcx>,
span: Span,
hir_id: hir::HirId,
) {
if let FnKind::Closure(_) = fn_kind {
return;
}
if_chain! {
if is_type_diagnostic_item(cx, return_ty(cx, hir_id), sym!(result_type));
then