Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip Drop terminators for enum variants without drop glue #68943

Merged

Commits on Feb 8, 2020

  1. 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.
    ecstatic-morse committed Feb 8, 2020
    Configuration menu
    Copy the full SHA
    b23d910 View commit details
    Browse the repository at this point in the history