Skip to content

Commit 272c414

Browse files
Preserve variance on error in generalizer
1 parent c3ec65f commit 272c414

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

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

0 commit comments

Comments
 (0)