about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-07-17 12:58:54 +0200
committerGitHub <noreply@github.com>2023-07-17 12:58:54 +0200
commit93b9812be840ec218bf499dcc5c6f81f20ea3002 (patch)
tree99f59b3ad68e0fcc2e60459b7def45ba2d92c656 /compiler/rustc_errors/src
parenteca9c0101c98df239e02c34f7b802cf775b86d08 (diff)
parent56633b3f51967f544c988dcabbcd1b99f4cc3558 (diff)
downloadrust-93b9812be840ec218bf499dcc5c6f81f20ea3002.tar.gz
rust-93b9812be840ec218bf499dcc5c6f81f20ea3002.zip
Rollup merge of #113770 - dtolnay:derivevoid, r=compiler-errors,nnethercote
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`).](https://rust.godbolt.org/z/P79joGMh3)
Diffstat (limited to 'compiler/rustc_errors/src')
0 files changed, 0 insertions, 0 deletions