bors c0939b18b8 Auto merge of #12409 - cookie-s:fix-identityop-duplicate-errors, r=Alexendoo
[`identity_op`]: Fix duplicate diagnostics

Relates to #12379

In the `identity_op` lint, the following diagnostic was emitted two times

```
  --> tests/ui/identity_op.rs:156:5
   |
LL |     1 * 1;
   |     ^^^^^ help: consider reducing it to: `1`
   |
```

because both of the left operand and the right operand are the identity element of the multiplication.

This PR fixes the issue so that if a diagnostic is created for an operand, the check of the other operand will be skipped. It's fine because the result is always the same in the affected operators.

---

changelog: [`identity_op`]: Fix duplicate diagnostics
2024-03-04 14:43:38 +00:00
..
2023-08-11 14:02:28 +00:00
2024-02-04 17:38:09 +01:00
2023-08-11 14:02:28 +00:00
2024-02-20 07:53:04 +10:00
2024-02-20 07:53:04 +10:00
2023-12-10 15:36:31 -05:00
2024-02-27 15:22:39 +01:00
2024-02-27 15:22:39 +01:00
2023-08-11 14:02:28 +00:00
2023-08-11 14:02:28 +00:00
2023-08-11 14:02:28 +00:00
2024-01-15 17:15:09 +00:00
2023-08-11 14:02:28 +00:00
2024-02-24 15:02:10 +01:00
2024-02-24 15:02:10 +01:00
2024-02-24 15:02:10 +01:00
2023-06-09 21:39:58 -04:00
2023-08-11 14:02:28 +00:00
2023-09-07 22:39:11 +02:00
2023-08-11 14:02:28 +00:00
2023-08-11 14:02:28 +00:00
2023-08-11 14:02:28 +00:00
2023-08-11 14:02:28 +00:00
2024-02-15 06:22:15 +09:00
2024-02-23 17:38:39 +01:00
2023-08-11 14:02:28 +00:00
2024-02-21 23:26:29 +09:00
2024-02-21 23:26:29 +09:00
2023-08-11 14:02:28 +00:00
2023-08-11 14:02:28 +00:00
2023-08-11 14:02:28 +00:00
2024-01-02 19:21:51 -05:00
2023-08-11 14:02:28 +00:00
2023-08-11 14:02:28 +00:00
2024-02-23 17:38:39 +01:00
2023-08-11 14:02:28 +00:00
2024-02-24 00:35:48 +08:00
2024-02-24 00:35:48 +08:00
2024-02-24 00:35:48 +08:00
2023-08-11 14:02:28 +00:00