Commit Graph

3 Commits

Author SHA1 Message Date
Aurelia Molzer
539f8400e7 Clarify panic-drop test for select_unpredictable 2025-08-30 13:01:32 +02:00
Aurelia Molzer
21bdfa14cb 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.
2025-08-09 18:12:56 +02:00
Amanieu d'Antras
e5e5fb9d80 Fix drop handling in hint::select_unpredictable
This intrinsic doesn't drop the value that is not selected so this is
manually done in the public function that wraps the intrinsic.
2025-04-17 17:30:53 +02:00