David Tolnay
f441adc89a
Generate safe stable code for derives on empty enums
...
Generate `match *self {}` instead of `unsafe { core::intrinsics::unreachable() }`.
This is:
1. safe
2. stable
for the benefit of everyone looking at these derived impls through `cargo expand`.
Both expansions compile to the same code at all optimization levels (including `0`).
2023-07-16 15:02:08 -07:00
..
2023-07-14 17:48:13 -04:00
2023-07-12 21:38:55 -04:00
2023-07-12 21:49:27 -04:00
2023-07-11 01:19:11 +02:00
2023-07-16 19:22:03 +08:00
2023-07-14 19:33:26 +02:00
2023-07-16 15:02:08 -07:00
2023-07-15 15:39:53 +00:00
2023-07-14 13:27:35 +01:00
2023-07-16 01:56:23 +00:00
2023-07-16 10:59:45 +00:00
2023-07-14 13:27:35 +01:00
2023-07-14 10:10:15 +02:00
2023-07-03 07:20:51 +00:00
2023-07-11 22:55:23 -05:00
2023-07-07 13:13:18 +00:00
2023-07-12 21:49:27 -04:00
2023-07-12 21:49:27 -04:00
2023-07-16 19:22:03 +08:00
2023-07-12 21:49:27 -04:00
2023-07-15 22:02:16 +00:00
2023-07-16 19:22:03 +08:00
2023-07-12 21:49:27 -04:00
2023-07-12 21:49:27 -04:00
2023-07-14 13:27:35 +01:00
2023-07-15 22:23:05 +00:00
2023-07-05 13:11:17 +02:00
2023-07-14 13:27:35 +01:00
2023-07-13 08:26:02 +08:00
2023-07-16 01:56:23 +00:00
2023-07-02 21:02:31 +02:00
2023-07-12 21:49:27 -04:00
2023-07-14 19:33:29 +02:00
2023-07-15 15:39:53 +00:00
2023-07-15 11:59:38 -04:00
2023-07-14 13:27:35 +01:00
2023-07-14 17:32:59 +00:00
2023-07-14 13:27:35 +01:00
2023-07-12 21:49:27 -04:00
2023-07-16 19:22:03 +08:00
2023-07-14 13:27:35 +01:00
2023-07-05 07:30:28 +00:00
2023-07-14 13:27:35 +01:00
2023-07-03 13:51:54 -07:00
2023-07-10 19:01:30 +00:00
2023-07-14 12:09:27 +00:00
2023-07-16 19:22:03 +08:00
2023-07-14 13:27:35 +01:00
2023-07-14 17:48:13 -04:00
2023-07-15 19:42:51 +02:00
2023-07-14 13:27:35 +01:00
2023-07-14 13:27:35 +01:00
2023-07-15 15:39:53 +00:00
2023-07-14 13:27:35 +01:00