Don't emit coerce suggestions for a type into itself
This commit is contained in:
parent
a3c0a02361
commit
312d6b8e9a
1 changed files with 4 additions and 0 deletions
|
|
@ -30,6 +30,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
expected_ty_expr: Option<&'tcx hir::Expr<'tcx>>,
|
||||
error: Option<TypeError<'tcx>>,
|
||||
) {
|
||||
if expr_ty == expected {
|
||||
return;
|
||||
}
|
||||
|
||||
self.annotate_expected_due_to_let_ty(err, expr, error);
|
||||
|
||||
// Use `||` to give these suggestions a precedence
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue