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

MIR borrow check (under debug flag) #43108

Merged
merged 12 commits into from
Aug 16, 2017
Merged

Commits on Aug 16, 2017

  1. Move borrowck error msg construction to module in rustc_mir (for la…

    …ter reuse by mir borrowck).
    
    post-rebase: Do not put "(Ast)" suffix in error msg unless passed `-Z borrowck-mir`.
    (But unconditionally include "(Mir)" suffix for mir-borrowck errors.)
    pnkfelix committed Aug 16, 2017
    Configuration menu
    Copy the full SHA
    8e79fc7 View commit details
    Browse the repository at this point in the history
  2. Refactor trait BitDenotation to take Location instead of `BasicBl…

    …ock`/`usize` argument pairs.
    pnkfelix committed Aug 16, 2017
    Configuration menu
    Copy the full SHA
    cff060b View commit details
    Browse the repository at this point in the history
  3. Added dataflow analysis for Borrows.

    post-rebase: addressed review comment: rename `loc_map`/`location_map` and `rgn_map`/`region_map`.
    
    post-rebase: remove now unnecessary `mut` decl.
    
    post-rebase: address comments: bind iterator expr, and alpha-rename `loc`/`location` and `idx`/`index`.
    pnkfelix committed Aug 16, 2017
    Configuration menu
    Copy the full SHA
    9f6ef66 View commit details
    Browse the repository at this point in the history
  4. Migrated some code out of dataflow::drop_flag_effects and into its …

    …parent module.
    
    (This code is more general purpose than just supporting drop flag elaboration.)
    pnkfelix committed Aug 16, 2017
    Configuration menu
    Copy the full SHA
    e8ebc90 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3ef1afc View commit details
    Browse the repository at this point in the history
  6. Move DataFlowState::{each_bit,interpret_set} method definitions to …

    …parent module.
    
    Refactored `each_bit`, which traverses a `IdxSet`, so that the bulk of
    its implementation lives in `rustc_data_structures`.
    pnkfelix committed Aug 16, 2017
    Configuration menu
    Copy the full SHA
    9b8b8c6 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    869f05a View commit details
    Browse the repository at this point in the history
  8. MIR based borrow check (opt-in).

    One can either use `-Z borrowck-mir` or add the `#[rustc_mir_borrowck]` attribute
    to opt into MIR based borrow checking.
    
    Note that regardless of whether one opts in or not, AST-based borrow
    check will still run as well.  The errors emitted from AST-based
    borrow check will include a "(Ast)" suffix in their error message,
    while the errors emitted from MIR-based borrow check will include a
    "(Mir)" suffix.
    
    post-rebase: removed check for intra-statement mutual conflict;
    replaced with assertion checking that at most one borrow is generated
    per statement.
    
    post-rebase: removed dead code: `IdxSet::pairs` and supporting stuff.
    pnkfelix committed Aug 16, 2017
    Configuration menu
    Copy the full SHA
    018784a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    15c411d View commit details
    Browse the repository at this point in the history
  10. Cleanup: Every BitDenotation is a DataflowOperator, so build that…

    … in.
    
    Post-rebase: ariel confirmed `SetDiscriminant` should indeed be a mutate.
    pnkfelix committed Aug 16, 2017
    Configuration menu
    Copy the full SHA
    b6528f0 View commit details
    Browse the repository at this point in the history
  11. Address review comment: StatementKind::StorageDead has an effect (r…

    …unning dtors) relevant to borrowck.
    pnkfelix committed Aug 16, 2017
    Configuration menu
    Copy the full SHA
    6d6280e View commit details
    Browse the repository at this point in the history
  12. Moved mir-borrowck pass down to where comments say it should be.

    Added two fixmes: The `SimplifyBranches` pass cannot stay where it is,
    and `BorrowckMir` should be a query, not a pass. But I am going to
    leave those changes to a future PR.
    pnkfelix committed Aug 16, 2017
    Configuration menu
    Copy the full SHA
    8738a08 View commit details
    Browse the repository at this point in the history