1
Fork 0

review comment: potentially produce more suggestions for arg type mismatch

This commit is contained in:
Esteban Küber 2023-01-05 01:00:21 +00:00
parent f571862d17
commit 98f3936aa7

View file

@ -364,11 +364,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
param_expected.insert(error.expected, error.found);
}
}
for (param, (arg,arg_ty)) in param_args.iter() {
for (param, (arg, arg_ty)) in param_args.iter() {
let Some(expected) = param_expected.get(param) else { continue; };
let Some(found) = param_found.get(param) else { continue; };
if self.can_eq(self.param_env, *arg_ty, *found).is_err() { continue; }
self.suggest_deref_ref_or_into(err, arg, *expected, *found, None);
self.emit_coerce_suggestions(err, arg, *found, *expected, None, None);
}
let ty = eraser.fold_ty(ty);