diff options
| author | Aurelia Molzer <5550310+HeroicKatora@users.noreply.github.com> | 2025-08-09 17:54:43 +0200 |
|---|---|---|
| committer | Aurelia Molzer <5550310+197g@users.noreply.github.com> | 2025-08-09 18:12:56 +0200 |
| commit | 21bdfa14cbd99aba173751a2c723fb1e65de401b (patch) | |
| tree | 7ffcb6487fe32dc127660be1cc34f6a240e12717 /tests/ui/codegen/unsupported-static-initializer-in-const-array.rs | |
| parent | ca77504943887037504c7fc0b9bf06dab3910373 (diff) | |
| download | rust-21bdfa14cbd99aba173751a2c723fb1e65de401b.tar.gz rust-21bdfa14cbd99aba173751a2c723fb1e65de401b.zip | |
Ensure consistent drop for hint::select_unpredictable
There are a few alternatives to the implementation. The principal problem is that the selected value must be owned (in the sense of having any drop flag of sorts) when the unselected value is dropped, such that panic unwind goes through the drop of both. This ownership must then be passed on in return when the drop went smoothly. The basic way of achieving this is by extracting the selected value first, at the cost of relying on the optimizer a little more for detecting the copy as constructing the return value despite having a place in the body.
Diffstat (limited to 'tests/ui/codegen/unsupported-static-initializer-in-const-array.rs')
0 files changed, 0 insertions, 0 deletions
