This commit is contained in:
xizheyin 2025-04-13 13:27:41 +02:00 committed by GitHub
commit d7d87b6455
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -249,7 +249,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
rhs_ty_var,
Some(lhs_expr),
|err, ty| {
if let Op::BinOp(binop) = op
if !expr.span.in_external_macro(self.tcx.sess.source_map())
&& let Op::BinOp(binop) = op
&& binop.node == hir::BinOpKind::Eq
{
self.suggest_swapping_lhs_and_rhs(err, ty, lhs_ty, rhs_expr, lhs_expr);