bors
9d6d5d4894
Auto merge of #116751 - Nadrieril:lint-overlap-per-column, r=davidtwco
...
Lint overlapping ranges as a separate pass
This reworks the [`overlapping_range_endpoints`](https://doc.rust-lang.org/beta/nightly-rustc/rustc_lint_defs/builtin/static.OVERLAPPING_RANGE_ENDPOINTS.html ) lint. My motivations are:
- It was annoying to have this lint entangled with the exhaustiveness algorithm, especially wrt librarification;
- This makes the lint behave consistently.
Here's the consistency story. Take the following matches:
```rust
match (0u8, true) {
(0..=10, true) => {}
(10..20, true) => {}
(10..20, false) => {}
_ => {}
}
match (true, 0u8) {
(true, 0..=10) => {}
(true, 10..20) => {}
(false, 10..20) => {}
_ => {}
}
```
There are two semantically consistent options: option 1 we lint all overlaps between the ranges, option 2 we only lint the overlaps that could actually occur (i.e. the ones with `true`). Option 1 is what this PR does. Option 2 is possible but would require the exhaustiveness algorithm to track more things for the sake of the lint. The status quo is that we're inconsistent between the two.
Option 1 generates more false postives, but I prefer it from a maintainer's perspective. I do think the difference is minimal; cases where the difference is observable seem rare.
This PR adds a separate pass, so this will have a perf impact. Let's see how bad, it looked ok locally.
2023-10-27 14:10:42 +00:00
..
2023-08-19 18:47:08 +00:00
2023-04-12 16:17:31 +00:00
2023-04-12 16:17:31 +00:00
2023-04-12 16:17:31 +00:00
2023-05-12 10:26:50 +00:00
2023-08-28 03:16:48 -07:00
2023-08-28 03:16:48 -07:00
2023-10-26 17:58:02 +00:00
2023-10-26 17:58:02 +00:00
2023-06-16 19:39:48 +00:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:13:18 +00:00
2023-06-16 19:39:48 +00:00
2023-06-16 19:39:48 +00:00
2023-02-22 09:44:26 +08:00
2023-02-22 09:44:26 +08:00
2023-06-16 19:39:48 +00:00
2023-07-27 08:23:06 +00:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:13:18 +00:00
2023-10-20 21:14:01 +00:00
2023-10-08 10:06:17 +00:00
2023-05-30 12:40:35 +02:00
2023-05-30 12:40:35 +02:00
2023-08-12 17:18:46 +00:00
2023-08-12 17:18:46 +00:00
2023-08-12 17:18:46 +00:00
2023-09-28 16:13:38 +00:00
2023-07-03 09:12:15 +02:00
2023-06-18 20:56:30 +00:00
2023-07-07 13:13:18 +00:00
2023-07-14 12:35:33 +00:00
2023-06-16 19:39:48 +00:00
2023-09-28 16:13:38 +00:00
2023-09-28 16:13:38 +00:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:13:18 +00:00
2023-05-22 23:33:34 +00:00
2023-08-30 11:06:46 +00:00
2023-08-30 11:06:46 +00:00
2023-08-19 18:47:08 +00:00
2023-09-05 20:20:55 +00:00
2023-09-05 20:20:55 +00:00
2023-08-30 11:06:46 +00:00
2023-08-30 11:06:46 +00:00
2023-08-30 11:06:46 +00:00
2023-08-30 11:06:46 +00:00
2023-08-30 11:06:46 +00:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:13:18 +00:00
2023-10-08 10:06:17 +00:00
2023-10-25 12:04:54 +00:00
2023-10-25 12:04:54 +00:00
2023-10-25 12:04:54 +00:00
2023-10-25 12:04:54 +00:00
2023-06-22 15:51:20 +00:00
2023-06-22 15:51:20 +00:00
2023-06-22 15:51:20 +00:00
2023-06-22 15:51:20 +00:00
2023-07-21 13:19:36 +00:00
2023-07-21 13:19:36 +00:00
2023-07-07 13:17:00 +00:00
2023-07-07 13:17:00 +00:00
2023-07-07 13:17:00 +00:00
2023-07-07 13:17:00 +00:00
2023-07-07 13:13:18 +00:00
2023-06-16 19:39:48 +00:00
2023-06-16 19:39:48 +00:00
2023-10-23 23:35:27 +00:00
2023-06-21 16:33:17 +00:00
2023-06-21 16:33:17 +00:00
2023-04-12 16:17:31 +00:00
2023-08-30 11:06:46 +00:00
2023-10-08 10:06:17 +00:00
2023-10-08 10:06:17 +00:00
2023-04-12 16:17:31 +00:00
2023-04-12 16:17:31 +00:00
2023-08-30 11:06:46 +00:00
2023-04-12 16:17:31 +00:00
2023-09-23 13:47:30 +00:00
2023-09-28 16:13:38 +00:00
2023-10-26 17:58:02 +00:00
2023-10-26 17:58:02 +00:00
2023-05-12 10:24:03 +00:00
2023-06-22 15:00:12 +00:00
2023-08-27 22:03:16 +00:00
2023-06-16 19:39:48 +00:00
2023-04-12 16:17:31 +00:00
2023-10-20 21:14:02 +00:00
2023-04-12 16:17:31 +00:00
2023-04-12 16:17:31 +00:00
2023-04-12 16:17:31 +00:00
2023-04-12 16:17:31 +00:00
2023-07-07 13:13:18 +00:00
2023-10-20 21:14:02 +00:00
2023-10-20 21:14:01 +00:00
2023-04-12 16:17:31 +00:00
2023-04-12 16:17:31 +00:00
2023-04-12 16:17:31 +00:00
2023-04-12 16:17:31 +00:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:13:18 +00:00
2023-04-12 16:17:31 +00:00
2023-07-07 13:13:18 +00:00
2023-02-16 15:14:45 +11:00
2023-09-21 22:20:58 +02:00
2023-07-07 13:13:18 +00:00
2023-04-15 15:23:32 -07:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:17:00 +00:00
2023-07-07 13:17:00 +00:00
2023-04-12 16:17:31 +00:00
2023-04-12 16:17:31 +00:00
2023-06-19 14:49:56 +00:00
2023-07-07 13:13:18 +00:00
2023-04-12 16:17:31 +00:00
2023-08-30 11:06:46 +00:00
2023-08-30 11:06:46 +00:00
2023-04-12 16:17:31 +00:00
2023-04-12 16:17:31 +00:00
2023-04-12 16:17:31 +00:00
2023-10-20 21:14:02 +00:00
2023-10-20 21:14:02 +00:00
2023-10-27 05:16:26 +02:00
2023-01-30 21:51:35 +00:00
2023-05-12 00:10:52 +00:00
2023-01-30 21:51:35 +00:00
2023-05-12 00:10:52 +00:00
2023-07-06 02:45:54 +09:00
2023-07-06 02:45:54 +09:00
2023-02-21 14:50:51 +00:00
2023-08-30 11:06:46 +00:00
2023-08-30 11:06:46 +00:00
2023-06-22 15:36:42 +00:00
2023-06-22 15:51:14 +00:00
2023-08-30 11:06:46 +00:00
2023-08-30 11:06:46 +00:00
2023-08-30 11:06:46 +00:00
2023-05-26 14:42:52 +00:00
2023-05-26 14:42:52 +00:00
2023-09-13 17:35:44 +00:00
2023-09-13 17:35:44 +00:00
2023-07-07 13:17:00 +00:00
2023-07-07 13:13:18 +00:00
2023-09-21 17:47:09 +00:00
2023-09-21 17:47:09 +00:00
2023-07-21 13:19:36 +00:00
2023-09-14 15:16:48 +00:00
2023-09-14 15:16:48 +00:00
2023-06-27 23:31:06 +00:00
2023-07-07 13:13:18 +00:00
2023-06-22 15:36:42 +00:00
2023-06-22 15:51:14 +00:00
2023-10-05 18:56:30 +03:00
2023-06-24 13:00:15 +00:00
2023-06-24 13:00:15 +00:00
2023-10-13 19:13:56 +00:00
2023-10-13 19:13:56 +00:00
2023-10-13 19:18:46 +00:00
2023-06-21 16:41:52 +00:00
2023-06-22 15:00:12 +00:00
2023-06-16 19:39:48 +00:00
2023-08-02 13:40:28 +03:00
2023-08-02 13:40:28 +03:00
2023-10-16 18:23:12 +00:00
2023-10-16 18:23:12 +00:00
2023-07-18 15:56:03 +00:00
2023-07-18 15:56:03 +00:00
2023-07-18 15:56:03 +00:00
2023-07-18 15:56:03 +00:00
2023-10-26 17:58:02 +00:00
2023-10-26 17:58:02 +00:00
2023-10-18 06:19:04 +00:00
2023-10-18 06:19:04 +00:00
2023-10-18 06:19:04 +00:00
2023-08-30 11:06:46 +00:00
2023-06-16 19:39:48 +00:00
2023-06-16 19:39:48 +00:00
2023-06-16 19:39:48 +00:00
2023-06-16 19:39:48 +00:00
2023-10-05 18:56:30 +03:00
2023-07-07 13:13:18 +00:00
2023-07-07 13:13:18 +00:00
2023-10-04 19:51:43 +00:00
2023-10-04 19:51:43 +00:00
2023-06-16 19:39:48 +00:00
2023-04-12 16:17:31 +00:00
2023-08-12 17:18:46 +00:00
2023-08-12 17:18:46 +00:00
2023-08-06 12:08:32 +00:00
2023-08-06 12:08:32 +00:00
2023-06-22 15:51:19 +00:00
2023-09-05 20:20:55 +00:00
2023-09-05 20:20:55 +00:00
2023-08-08 09:39:42 +00:00
2023-10-08 10:06:17 +00:00
2023-05-07 01:41:20 +03:00
2023-10-08 10:06:17 +00:00
2023-10-08 10:06:17 +00:00
2023-05-07 01:41:20 +03:00