bors
0c42e451d6
Auto merge of #11791 - Jacherr:iter_over_hash_type, r=Jarcho
...
Implement new lint `iter_over_hash_type`
Implements and fixes https://github.com/rust-lang/rust-clippy/issues/11788
This PR adds a new *restriction* lint `iter_over_hash_type` which prevents `Hash`-types (that is, `HashSet` and `HashMap`) from being used as the iterator in `for` loops.
The justification for this is because in `Hash`-based types, the ordering of items is not guaranteed and may vary between executions of the same program on the same hardware. In addition, it reduces readability due to the unclear iteration order.
The implementation of this lint also ensures the following:
- Calls to `HashMap::keys`, `HashMap::values`, and `HashSet::iter` are also denied when used in `for` loops,
- When this expression is used in procedural macros, it is not linted/denied.
changelog: add new `iter_over_hash_type` lint to prevent unordered iterations through hashed data structures
2023-11-14 15:55:00 +00:00
..
2023-10-21 14:16:11 +02:00
2023-11-02 17:24:30 +01:00
2023-09-12 18:44:06 +02:00
2023-11-12 12:15:30 -08:00
2023-11-01 16:25:15 +00:00
2023-10-29 23:04:17 +01:00
2023-10-06 17:35:45 +02:00
2023-11-14 22:05:44 +09:00
2023-10-23 13:03:11 -07:00
2023-10-21 14:16:11 +02:00
2023-10-06 17:35:45 +02:00
2023-09-10 18:56:39 +00:00
2023-09-10 18:56:39 +00:00
2023-11-08 19:38:59 +01:00
2023-11-08 19:38:59 +01:00
2023-09-23 13:47:30 +00:00
2023-09-23 13:47:30 +00:00
2023-09-10 18:56:39 +00:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-09-21 22:20:58 +02:00
2023-09-21 22:20:58 +02:00
2023-10-18 23:53:18 +00:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-25 11:28:58 +02:00
2023-09-12 18:44:06 +02:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-14 17:52:36 +00:00
2023-09-14 17:52:36 +00:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-10-22 21:27:46 +08:00
2023-10-22 21:27:46 +08:00
2023-10-29 17:34:11 +01:00
2023-10-29 17:34:11 +01:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-11-11 15:54:58 -05:00
2023-11-11 15:54:58 -05:00
2023-11-11 15:54:58 -05:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-10-27 16:28:10 +02:00
2023-10-27 16:28:10 +02:00
2023-10-27 16:28:10 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-10-04 21:09:54 +00:00
2023-09-23 13:47:30 +00:00
2023-10-03 02:25:32 +00:00
2023-11-01 23:26:43 +01:00
2023-11-01 23:26:43 +01:00
2023-11-01 23:26:43 +01:00
2023-09-12 18:44:06 +02:00
2023-10-17 10:41:15 +08:00
2023-10-17 10:41:15 +08:00
2023-10-17 10:41:15 +08:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-10-13 21:01:36 +00:00
2023-10-13 21:01:36 +00:00
2023-10-13 21:01:36 +00:00
2023-09-14 22:34:05 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-22 20:19:31 +02:00
2023-10-22 20:19:31 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-11-13 16:52:59 +00:00
2023-11-13 16:52:59 +00:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-10-22 20:19:31 +02:00
2023-10-22 20:19:31 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-10-20 21:14:01 +00:00
2023-10-20 21:14:01 +00:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-29 23:17:49 +09:00
2023-09-29 23:17:49 +09:00
2023-09-29 23:17:49 +09:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-11-09 17:57:06 -05:00
2023-11-09 17:57:06 -05:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-10-30 20:54:24 +01:00
2023-10-30 20:54:24 +01:00
2023-10-30 20:54:24 +01:00
2023-11-11 13:48:26 +01:00
2023-11-11 13:48:26 +01:00
2023-11-11 13:48:26 +01:00
2023-09-08 14:05:57 +02:00
2023-09-08 14:05:57 +02:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-10-23 20:05:10 +00:00
2023-10-23 20:05:10 +00:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-10-21 14:16:11 +02:00
2023-10-04 21:09:54 +00:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-11-11 14:50:19 -05:00
2023-11-11 14:50:19 -05:00
2023-11-11 14:50:19 -05:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 10:26:11 +02:00
2023-09-08 23:42:57 +00:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-10-21 14:16:11 +02:00
2023-10-06 17:35:45 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-10-23 14:37:13 +00:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-09-25 11:28:58 +02:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-11-02 17:24:30 +01:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-25 11:28:58 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-09-07 21:43:06 +02:00
2023-09-07 21:43:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-10-30 20:54:24 +01:00
2023-11-11 21:01:36 +01:00
2023-10-30 20:54:24 +01:00
2023-10-30 20:54:24 +01:00
2023-11-11 21:01:36 +01:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-10-21 14:16:11 +02:00
2023-10-04 21:09:54 +00:00
2023-10-04 21:09:54 +00:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-10-13 21:01:36 +00:00
2023-10-13 21:01:36 +00:00
2023-10-31 18:21:34 +01:00
2023-10-31 18:21:34 +01:00
2023-10-31 18:21:34 +01:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-10-30 20:54:24 +01:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-09-25 11:28:58 +02:00
2023-11-09 23:03:44 +00:00
2023-11-09 23:03:44 +00:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-09-12 18:44:06 +02:00
2023-10-25 15:15:29 +02:00
2023-10-25 15:15:29 +02:00
2023-10-25 15:15:29 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00
2023-10-06 17:35:45 +02:00