Normalize expected ty in call arguments

This commit is contained in:
hkalbasi 2023-07-22 01:06:58 +03:30
parent ed8e1fd472
commit b7d91ca5b2
2 changed files with 45 additions and 0 deletions

View file

@ -1665,6 +1665,7 @@ impl InferenceContext<'_> {
// the parameter to coerce to the expected type (for example in
// `coerce_unsize_expected_type_4`).
let param_ty = self.normalize_associated_types_in(param_ty);
let expected_ty = self.normalize_associated_types_in(expected_ty);
let expected = Expectation::rvalue_hint(self, expected_ty);
// infer with the expected type we have...
let ty = self.infer_expr_inner(arg, &expected);