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

Compute type fragments left over from moves #17439

Closed

Commits on Sep 18, 2014

  1. Refactor: merge two fields of mc::CopiedUpvar into a single `ty::Up…

    …varId`.
    
    (This refactoring looks like a wash in this commit, in terms of
    overall code-cleanliness; but it makes things nicer in a future commit
    for static drop semantics.)
    pnkfelix committed Sep 18, 2014
    Configuration menu
    Copy the full SHA
    51e17ba View commit details
    Browse the repository at this point in the history
  2. Added CaptureKind to LpUpvar and generalized it to represent by-r…

    …ef and by-value captures.
    
    This is necessary to be able to properly backtrack in a loan-path to
    the definition site of the original variable (which I found necessary
    in later commits).
    pnkfelix committed Sep 18, 2014
    Configuration menu
    Copy the full SHA
    fedfebc View commit details
    Browse the repository at this point in the history
  3. Add LpDowncast, LoanPath variant tracking downcasts in match arms.

    `LpDowncast` carries the `DefId` of the variant itself.  To support
    this, added the enum variant `DefId` to the `cat_downcast` variant in
    `mem_categorization::categorization`.
    pnkfelix committed Sep 18, 2014
    Configuration menu
    Copy the full SHA
    b2b39e8 View commit details
    Browse the repository at this point in the history
  4. Add ty to LoanPath.

    To make this clean, refactored old `LoanPath` enum into a
    `LoanPath` struct with a `ty::t` and a newly-added `LoanPathVariant` enum.
    
    This enabled me to get rid of the ugly and fragile `LoanPath::to_type`
    method, and I can probably also get rid of other stuff that was
    supporting it, maybe.
    pnkfelix committed Sep 18, 2014
    Configuration menu
    Copy the full SHA
    8f3bf7d View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2014

  1. Configuration menu
    Copy the full SHA
    d84035b View commit details
    Browse the repository at this point in the history
  2. Track what drop obligations are established on match arms.

    This is accomplished by:
    
    1. Add `MatchMode` enum to `expr_use_visitor`.
    
    2. Computing the match mode for each pattern via a pre-pass, and then
       passing the mode along when visiting the pattern in
       expr_use_visitor.
    
    3. Adding a `fn matched_pat` callback to expr_use_visitor, which is called on
       all nodes of the pattern (as opposed to `fn consume_pat`, which is only
       invoked for identifiers at the leaves of the pattern), and invoking it
       accordingly.
    
    Of particular interest are the `cat_downcast` instances established
    when matching enum variants.
    pnkfelix committed Sep 22, 2014
    Configuration menu
    Copy the full SHA
    21dd404 View commit details
    Browse the repository at this point in the history
  3. Distinguish move semantics for a @ Var(_) from that of Var(_).

    Note that due to PR rust-lang#16053, we only actually deal with `a @ Var(_)`
    here, (as opposed to a hypothetical `a @ Var(ref b)`, which cannot
    currenty arise, and maybe will never be supported for non-copy data).
    pnkfelix committed Sep 22, 2014
    Configuration menu
    Copy the full SHA
    94402f2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f9080aa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    77d889f View commit details
    Browse the repository at this point in the history
  6. Add span_end_err as a way to print an error message at the *end* of…

    … a span.
    
    This will be utilized by the rustc_drop_obligations
    code-annotation-via-errors hack to print out the drop obligations that
    are removed at the end of scopes.
    pnkfelix committed Sep 22, 2014
    Configuration menu
    Copy the full SHA
    2fa8ee4 View commit details
    Browse the repository at this point in the history
  7. Added code to emit the gen/kill sets in source annotated form.

    When you add `rustc_drop_obligations` as an annotation on a function,
    it will print all of the drop-obligation manipulations as individual
    compiler errors associated with the expressions that caused the effect
    on the drop obligation state.
    
    Surround drop-obligations in output with `` quotes to help unintended prefix matches
    
    Prints scope-end messages at end of their scope.
    pnkfelix committed Sep 22, 2014
    Configuration menu
    Copy the full SHA
    33ac411 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1161da9 View commit details
    Browse the repository at this point in the history