mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-29 16:13:40 +00:00
Don't delay invalid lhs bug unless we know it'll be replaced by one in check_overloaded_binop
This commit is contained in:
parent
ae0030beb0
commit
771456264b
@ -57,9 +57,20 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
)
|
)
|
||||||
.is_ok()
|
.is_ok()
|
||||||
{
|
{
|
||||||
// Suppress this error, since we already emitted
|
// If LHS += RHS is an error, but *LHS += RHS is successful, then we will have
|
||||||
// a deref suggestion in check_overloaded_binop
|
// emitted a better suggestion during error handling in check_overloaded_binop.
|
||||||
err.downgrade_to_delayed_bug();
|
if self
|
||||||
|
.lookup_op_method(
|
||||||
|
lhs_ty,
|
||||||
|
Some(rhs_ty),
|
||||||
|
Some(rhs),
|
||||||
|
Op::Binary(op, IsAssign::Yes),
|
||||||
|
expected,
|
||||||
|
)
|
||||||
|
.is_err()
|
||||||
|
{
|
||||||
|
err.downgrade_to_delayed_bug();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user