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

Treat Drop as a rmw operation #107271

Merged
merged 1 commit into from
Feb 8, 2023
Merged

Treat Drop as a rmw operation #107271

merged 1 commit into from
Feb 8, 2023

Commits on Jan 29, 2023

  1. Treat Drop as a rmw operation

    Previously, a Drop terminator was considered a move in MIR.
    This commit changes the behavior to only treat Drop as a mutable
    access to the dropped place.
    
    In order for this change to be correct, we need to guarantee that
      a) A dropped value won't be used again
      b) Places that appear in a drop won't be used again before a
         subsequent initialization.
    
    We can ensure this to be correct at MIR construction because Drop
    will only be emitted when a variable goes out of scope,
    thus having:
      (a) as there is no way of reaching the old value. drop-elaboration
         will also remove any uninitialized drop.
      (b) as the place can't be named following the end of the scope.
    
    However, the initialization status, previously tracked by moves,
    should also be tied to the execution of a Drop, hence the
    additional logic in the dataflow analyses.
    zeegomo committed Jan 29, 2023
    Configuration menu
    Copy the full SHA
    68c1e2f View commit details
    Browse the repository at this point in the history