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

Capture precise paths in THIR and MIR #79553

Merged
merged 7 commits into from
Dec 12, 2020

Commits on Dec 6, 2020

  1. Writeback min_capture map to TypeckResults

    - Derive TypeFoldable on `hir::place::Place` and associated
      structs, to them to be written into typeck results.
    
    Co-authored-by: Jennifer Wills <wills.jenniferg@gmail.com>
    Co-authored-by: Logan Mosier <logmosier@gmail.com>
    3 people committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    76c68aa View commit details
    Browse the repository at this point in the history
  2. Use min_captures for creating UpvarSusbts::tupled_upvar_tys

    - final_upvar_tys now reads types from places instead of using `node_ty`
    
    Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
    arora-aman and roxelo committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    6e5cca7 View commit details
    Browse the repository at this point in the history
  3. Move handling UpvarRef to PlaceBuilder

    - This allows us to delay figuring out the index of a capture
      in the closure structure when all projections to atleast form
      a capture have been applied to the builder
    
    Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
    arora-aman and roxelo committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    d952362 View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2020

  1. Use Places for captures in MIR

    - Use closure_min_capture maps to capture precise paths
    - PlaceBuilder now searches for ancestors in min_capture list
    - Add API to `Ty` to allow access to the n-th element in a
      tuple in O(1) time.
    
    Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
    arora-aman and roxelo committed Dec 10, 2020
    Configuration menu
    Copy the full SHA
    6a1d069 View commit details
    Browse the repository at this point in the history
  2. Use precise places when lowering Closures in THIR

    - Closures now use closure_min_captures to figure out captured paths
    - Build upvar_mutbls using closure_min_captures
    - Change logic in limit_capture_mutability to differentiate b/w
      capturing parent's local variable or capturing a variable that is
      captured by the parent (in case of nested closure) using PlaceBase.
    
    Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
    arora-aman and roxelo committed Dec 10, 2020
    Configuration menu
    Copy the full SHA
    e2efdd1 View commit details
    Browse the repository at this point in the history
  3. Use closure_min_captures in borrow checker

    - Use closure_min_captures to generate the Upvar structure that
      stores information for diagnostics and information about
      mutability of captures.
    arora-aman committed Dec 10, 2020
    Configuration menu
    Copy the full SHA
    237ad12 View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2020

  1. Test cases for RFC 2229

    arora-aman committed Dec 11, 2020
    Configuration menu
    Copy the full SHA
    01df563 View commit details
    Browse the repository at this point in the history