1
Fork 0

Deeply normalize type trace in type error reporting

This commit is contained in:
Michael Goulet 2024-10-15 15:24:22 -04:00
parent 1920c66a8d
commit 4217b8702d
3 changed files with 38 additions and 1 deletions

View file

@ -1252,8 +1252,11 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
}
let (expected_found, exp_found, is_simple_error, values) = match values {
None => (None, Mismatch::Fixed("type"), false, None),
Some(ty::ParamEnvAnd { param_env: _, value: values }) => {
Some(ty::ParamEnvAnd { param_env, value: values }) => {
let mut values = self.resolve_vars_if_possible(values);
if self.next_trait_solver() {
values = deeply_normalize_for_diagnostics(self, param_env, values);
}
let (is_simple_error, exp_found) = match values {
ValuePairs::Terms(ExpectedFound { expected, found }) => {
match (expected.unpack(), found.unpack()) {