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

Refactor hir::Place #73489

Merged
merged 1 commit into from
Jun 20, 2020
Merged

Refactor hir::Place #73489

merged 1 commit into from
Jun 20, 2020

Commits on Jun 18, 2020

  1. Refactor hir::Place

    For the following code
    ```rust
    let c = || bar(foo.x, foo.x)
    ```
    
    We generate two different `hir::Place`s for both `foo.x`.
    Handling this adds overhead for analysis we need to do for RFC 2229.
    
    We also want to store type information at each Projection to support
    analysis as part of the RFC. This resembles what we have for
    `mir::Place`
    
    This commit modifies the Place as follows:
    - Rename to `PlaceWithHirId`, where there `hir_id` is that of the
    expressioin.
    - Move any other information that describes the access out to another
    struct now called `Place`.
    - Removed `Span`, it can be accessed using the [hir
    API](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.span)
    - Modify `Projection` to be a strucutre of its own, that currently only
    contains the `ProjectionKind`.
    
    Adding type information to projections wil be completed as part of rust-lang/project-rfc-2229#5
    
    Closes rust-lang/project-rfc-2229#3
    
    Co-authored-by: Aman Arora <[email protected]>
    Co-authored-by: Roxane Fruytier <[email protected]>
    arora-aman and roxelo committed Jun 18, 2020
    Configuration menu
    Copy the full SHA
    3659406 View commit details
    Browse the repository at this point in the history