Skip to content

Commit 9f05da7

Browse files
Preserve variance on error in generalizer
1 parent 6bdb8a4 commit 9f05da7

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
@@ -404,9 +404,9 @@ impl<'tcx> TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
404404
debug!(?self.ambient_variance, "new ambient variance");
405405
// Recursive calls to `relate` can overflow the stack. For example a deeper version of
406406
// `ui/associated-consts/issue-93775.rs`.
407-
let r = ensure_sufficient_stack(|| self.relate(a, b))?;
407+
let r = ensure_sufficient_stack(|| self.relate(a, b));
408408
self.ambient_variance = old_ambient_variance;
409-
Ok(r)
409+
r
410410
}
411411

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

0 commit comments

Comments
 (0)