Preserve variance on error in generalizer
This commit is contained in:
parent
77be7a3e0d
commit
3cb36317cd
1 changed files with 2 additions and 2 deletions
|
@ -440,9 +440,9 @@ impl<'tcx> TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
|
||||||
debug!(?self.ambient_variance, "new ambient variance");
|
debug!(?self.ambient_variance, "new ambient variance");
|
||||||
// Recursive calls to `relate` can overflow the stack. For example a deeper version of
|
// Recursive calls to `relate` can overflow the stack. For example a deeper version of
|
||||||
// `ui/associated-consts/issue-93775.rs`.
|
// `ui/associated-consts/issue-93775.rs`.
|
||||||
let r = ensure_sufficient_stack(|| self.relate(a, b))?;
|
let r = ensure_sufficient_stack(|| self.relate(a, b));
|
||||||
self.ambient_variance = old_ambient_variance;
|
self.ambient_variance = old_ambient_variance;
|
||||||
Ok(r)
|
r
|
||||||
}
|
}
|
||||||
|
|
||||||
#[instrument(level = "debug", skip(self, t2), ret)]
|
#[instrument(level = "debug", skip(self, t2), ret)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue