Propagate errors rather than using return_if_err

This commit is contained in:
Michael Goulet 2024-05-09 11:33:53 -04:00
parent db193c1c9d
commit e65cefcf6f
11 changed files with 17 additions and 13 deletions

View file

@ -9,7 +9,6 @@ use rustc_lint::LateContext;
use rustc_middle::mir::{FakeReadCause, Mutability};
use rustc_middle::ty::{self, BorrowKind};
use rustc_span::sym;
use rustc_trait_selection::infer::TyCtxtInferExt;
use super::ITER_OVEREAGER_CLONED;
use crate::redundant_clone::REDUNDANT_CLONE;
@ -75,7 +74,7 @@ pub(super) fn check<'tcx>(
closure.def_id,
&mut delegate,
)
.consume_body(body);
.consume_body(body).into_ok();
let mut to_be_discarded = false;