about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/example/std_example.rs
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2023-07-16 14:35:16 -0700
committerDavid Tolnay <dtolnay@gmail.com>2023-07-16 15:02:08 -0700
commitf441adc89a880df995ed95ca1402cfe8939d273b (patch)
treea2574fba42d26f995c2fb465ca0ef1732673d7b5 /compiler/rustc_codegen_gcc/example/std_example.rs
parentc4083faade32b16feb471ef082ce0b1e3fe94262 (diff)
downloadrust-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