diff options
| author | Michael Goulet <michael@errs.io> | 2024-02-19 20:36:17 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-03-01 01:20:49 +0000 |
| commit | 3cb36317cdea5c4de0224f64a0ec6db5cd50a8fd (patch) | |
| tree | b2a774065187d1b78b7ee6699942181b3871242d | |
| parent | 77be7a3e0df908c5ea9ea4a70d209782a7299b4b (diff) | |
| download | rust-3cb36317cdea5c4de0224f64a0ec6db5cd50a8fd.tar.gz rust-3cb36317cdea5c4de0224f64a0ec6db5cd50a8fd.zip | |
Preserve variance on error in generalizer
| -rw-r--r-- | compiler/rustc_infer/src/infer/relate/generalize.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_infer/src/infer/relate/generalize.rs b/compiler/rustc_infer/src/infer/relate/generalize.rs index e84d4ceaea8..b18c8a8b844 100644 --- a/compiler/rustc_infer/src/infer/relate/generalize.rs +++ b/compiler/rustc_infer/src/infer/relate/generalize.rs @@ -440,9 +440,9 @@ impl<'tcx> TypeRelation<'tcx> for Generalizer<'_, 'tcx> { debug!(?self.ambient_variance, "new ambient variance"); // Recursive calls to `relate` can overflow the stack. For example a deeper version of // `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; - Ok(r) + r } #[instrument(level = "debug", skip(self, t2), ret)] |
