diff options
| author | David Tolnay <dtolnay@gmail.com> | 2023-07-16 14:35:16 -0700 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2023-07-16 15:02:08 -0700 |
| commit | f441adc89a880df995ed95ca1402cfe8939d273b (patch) | |
| tree | a2574fba42d26f995c2fb465ca0ef1732673d7b5 /compiler/rustc_codegen_gcc/example/std_example.rs | |
| parent | c4083faade32b16feb471ef082ce0b1e3fe94262 (diff) | |
| download | rust-f441adc89a880df995ed95ca1402cfe8939d273b.tar.gz rust-f441adc89a880df995ed95ca1402cfe8939d273b.zip | |
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`).
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/std_example.rs')
0 files changed, 0 insertions, 0 deletions
