1
Fork 0

Update compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Co-authored-by: lcnr <rust@lcnr.de>
This commit is contained in:
xizheyin 2025-04-08 17:36:44 +08:00 committed by GitHub
parent c7272a6cbc
commit a8b0eb7c65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -198,7 +198,8 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
/// Returns `true` if a closure is inferred to be an `FnMut` closure.
fn is_closure_fn_mut(&self, fr: RegionVid) -> bool {
if let Some(ty::ReLateParam(late_param)) = self.to_error_region(fr).map(|r| r.kind())
if let Some(r) = self.to_error_region(fr)
&& let ty::ReLateParam(late_param) = r.kind()
&& let ty::LateParamRegionKind::ClosureEnv = late_param.kind
&& let DefiningTy::Closure(_, args) = self.regioncx.universal_regions().defining_ty
{