rust/compiler/rustc_infer/src
Dylan DPC 9cfd161cd5
Rollup merge of #99928 - compiler-errors:issue-99914, r=oli-obk
Do not leak type variables from opaque type relation

The "root cause" is that we call `InferCtxt::resolve_vars_if_possible` (3d9dd681f5) on the types we get back in `TypeError::Sorts` since I added a call to it in `InferCtxt::same_type_modulo_infer`. However if this `TypeError` comes from a `InferCtxt::commit_if_ok`, then it may reference type variables that do not exist anymore, which is problematic.

We avoid this by substituting the `TypeError` with the types we had before being generalized while handling opaques.

This is kinda gross, and I feel like we can get the same issue from other places where we generalize type/const inference variables. Maybe not? I don't know.

Fixes #99914
Fixes #99970
Fixes #100463
2022-08-30 16:56:07 +05:30
..
infer Rollup merge of #99928 - compiler-errors:issue-99914, r=oli-obk 2022-08-30 16:56:07 +05:30
traits anonymize all bound vars, not just regions 2022-07-28 16:13:47 +02:00
errors.rs Use IntoDiagnosticArg where it makes sense 2022-08-24 15:46:29 +03:00
lib.rs Revert let_chains stabilization 2022-08-29 19:34:11 +02:00