Skip to content

Commit a2999da

Browse files
Preserve variance on error in generalizer
1 parent 1bb3a9f commit a2999da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_infer/src/infer/relate/generalize.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,9 @@ impl<'tcx> TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
399399
debug!(?self.ambient_variance, "new ambient variance");
400400
// Recursive calls to `relate` can overflow the stack. For example a deeper version of
401401
// `ui/associated-consts/issue-93775.rs`.
402-
let r = ensure_sufficient_stack(|| self.relate(a, b))?;
402+
let r = ensure_sufficient_stack(|| self.relate(a, b));
403403
self.ambient_variance = old_ambient_variance;
404-
Ok(r)
404+
r
405405
}
406406

407407
#[instrument(level = "debug", skip(self, t2), ret)]

0 commit comments

Comments
 (0)