Skip to content

Commit 98f3936

Browse files
committed
review comment: potentially produce more suggestions for arg type mismatch
1 parent f571862 commit 98f3936

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_hir_typeck/src/demand.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
364364
param_expected.insert(error.expected, error.found);
365365
}
366366
}
367-
for (param, (arg,arg_ty)) in param_args.iter() {
367+
for (param, (arg, arg_ty)) in param_args.iter() {
368368
let Some(expected) = param_expected.get(param) else { continue; };
369369
let Some(found) = param_found.get(param) else { continue; };
370370
if self.can_eq(self.param_env, *arg_ty, *found).is_err() { continue; }
371-
self.suggest_deref_ref_or_into(err, arg, *expected, *found, None);
371+
self.emit_coerce_suggestions(err, arg, *found, *expected, None, None);
372372
}
373373

374374
let ty = eraser.fold_ty(ty);

0 commit comments

Comments
 (0)