You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Skip Drop terminators for enum variants without drop glue
When doing drop elaboration for an `enum` that may or may not be moved
out of (an open drop), we check the discriminant of the `enum` to
see whether the live variant has any drop flags and then check the drop flags
to see whether we need to drop each field. Sometimes, however, the live
variant has no move paths. In this case, we still emit a drop terminator
for the entire enum after checking the enum discriminant.
This commit skips emitting the drop terminator when the "otherwise"
variants, those without move paths, have no drop glue. This was
frequently the case with `Option`, as the `None` variant has no drop
glue and no move path.
0 commit comments