about summary refs log tree commit diff
path: root/src/rustllvm/ExecutionEngineWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-04-27 20:46:48 +0000
committerbors <bors@rust-lang.org>2015-04-27 20:46:48 +0000
commit9c88f3be126d0fe02a92c20e1d78192f4b648401 (patch)
tree4c88238657a17c1fafca0f5bd1726479f6428994 /src/rustllvm/ExecutionEngineWrapper.cpp
parent857ef6e272e5634cb9f3e6ee50eb6bc2a2e71651 (diff)
parent805349a50b9577e81b04e34a7482d6d5dcb01527 (diff)
downloadrust-9c88f3be126d0fe02a92c20e1d78192f4b648401.tar.gz
rust-9c88f3be126d0fe02a92c20e1d78192f4b648401.zip
Auto merge of #24765 - pnkfelix:fsk-enum-swapindrop, r=nikomatsakis
Inspect enum discriminant *after* calling its destructor

Includes some drive-by cleanup (e.g. changed some field and method names to reflect fill-on-drop; added comments about zero-variant enums being classified as `_match::Single`).

Probably the most invasive change was the expansion of the maps `available_drop_glues` and `drop_glues` to now hold two different kinds of drop glues; there is the (old) normal drop glue, and there is (new) drop-contents glue that jumps straight to dropping the contents of a struct or enum, skipping its destructor.

 * For all types that do not have user-defined Drop implementations, the normal glue is generated as usual (i.e. recursively dropping the fields of the data structure).

  (And this actually is exactly what the newly-added drop-contents glue does as well.)

 * For types that have user-defined Drop implementations, the "normal" drop glue now schedules a cleanup before invoking the `Drop::drop` method that will call the drop-contents glue after that invocation returns.

Fix #23611.

----

Is this a breaking change?  The prior behavior was totally unsound, and it seems unreasonable that anyone was actually relying on it.

Nonetheless, since there is a user-visible change to the language semantics, I guess I will conservatively mark this as a:

[breaking-change]

(To see an example of what sort of user-visible change this causes, see the comments in the regression test.)
Diffstat (limited to 'src/rustllvm/ExecutionEngineWrapper.cpp')
0 files changed, 0 insertions, 0 deletions