diff options
| author | lcnr <rust@lcnr.de> | 2025-09-08 11:41:43 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2025-09-08 14:17:56 +0200 |
| commit | b51a3a565a056235f3864e2cefdb9449f6b0dcb1 (patch) | |
| tree | 525669b67e94ecdfe97995123eb4f79886831f2d /compiler/rustc_infer/src/infer/canonical/mod.rs | |
| parent | f51458640840cb94c32f1e55431b1c855ca22e88 (diff) | |
| download | rust-b51a3a565a056235f3864e2cefdb9449f6b0dcb1.tar.gz rust-b51a3a565a056235f3864e2cefdb9449f6b0dcb1.zip | |
review
Diffstat (limited to 'compiler/rustc_infer/src/infer/canonical/mod.rs')
| -rw-r--r-- | compiler/rustc_infer/src/infer/canonical/mod.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_infer/src/infer/canonical/mod.rs b/compiler/rustc_infer/src/infer/canonical/mod.rs index 517331c3245..f99f228e19d 100644 --- a/compiler/rustc_infer/src/infer/canonical/mod.rs +++ b/compiler/rustc_infer/src/infer/canonical/mod.rs @@ -93,10 +93,11 @@ impl<'tcx> InferCtxt<'tcx> { match kind { CanonicalVarKind::Ty { ui, sub_root } => { let vid = self.next_ty_vid_in_universe(span, universe_map(ui)); - // Fetch the `sub_root` in case it exists. + // If this inference variable is related to an earlier variable + // via subtyping, we need to add that info to the inference context. if let Some(prev) = previous_var_values.get(sub_root.as_usize()) { if let &ty::Infer(ty::TyVar(sub_root)) = prev.expect_ty().kind() { - self.inner.borrow_mut().type_variables().sub(vid, sub_root); + self.sub_unify_ty_vids_raw(vid, sub_root); } else { unreachable!() } |
