summary refs log tree commit diff
path: root/src/librustc_mir/dataflow
AgeCommit message (Collapse)AuthorLines
2017-10-08Auto merge of #45016 - pnkfelix:mir-borrowck-gather-and-signal-move-errors, ↵bors-64/+132
r=nikomatsakis MIR-borrowck: gather and signal any move errors When building up the `MoveData` structure for a given MIR, also accumulate any erroneous actions, and then report all of those errors when the construction is complete. This PR adds a host of move-related error constructor methods to `trait BorrowckErrors`. I think I got the notes right; but we should plan to audit all of the notes before turning MIR-borrowck on by default. Fix #44830
2017-10-05Rollup merge of #44987 - pnkfelix:mir-borrowck-fix-borrowindexes-ice, r=arielb1kennytm-5/+5
`EndRegion` do not always correspond to borrow-data entries Remove assertion that the argument to every `EndRegion` correspond to some dataflow-tracked borrow-data entry. Fix #44828 (The comment thread on the aforementioned issue discusses why its best to just remove this assertion.)
2017-10-04Made `move_paths::MoveError` take span param in `cannot_move_out_of` ctor.Felix S. Klock II-48/+79
Implicitly threaded `Location` through MoveData construction via a `Gatherer` struct (so that we could look up the span corresponding to the location when we need to signal an error).
2017-10-04mir-borrowck: Gather move errors during MoveData construction and report them.Felix S. Klock II-32/+69
Currently is using DUMMY_SP as the associated span; a follow-up commit will pass in appropriate spans when constructing the errors.
2017-10-04add notes to report_conflicting_borrow MIR borrowckMikhail Modin-2/+25
2017-10-02Remove assertion that the argument to every `EndRegion` correspond toFelix S. Klock II-5/+5
some dataflow-tracked borrow-data entry. Fix #44828 (The comment thread on the aforementioned issue discusses why its best to just remove this assertion.)
2017-09-13Analyse storage liveness and preserve it during generator transformationJohn Kåre Alsaker-0/+110
2017-09-03rustc_mir: use Local in ProjectionElem::Index.Eduard-Mihai Burtescu-2/+5
2017-09-01rustc: rename CodeExtent to Scope and RegionMaps to ScopeTree.Eduard-Mihai Burtescu-6/+6
2017-08-21Merge remote-tracking branch 'origin/master' into genAlex Crichton-163/+2
2017-08-19rustc: Remove some dead codeVadim Petrochenkov-163/+2
2017-08-16Merge remote-tracking branch 'origin/master' into genAlex Crichton-502/+790
2017-08-16Merge remote-tracking branch 'origin/master' into genAlex Crichton-17/+17
2017-08-16Cleanup: Every `BitDenotation` is a `DataflowOperator`, so build that in.Felix S. Klock II-20/+11
Post-rebase: ariel confirmed `SetDiscriminant` should indeed be a mutate.
2017-08-16Added some documentation for the `struct BlockSets` in `rustc_mir::dataflow`.Felix S. Klock II-0/+19
2017-08-16MIR based borrow check (opt-in).Felix S. Klock II-4/+118
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.
2017-08-16Factored `MoveData` construction code into `builder` submodule.Felix S. Klock II-313/+334
2017-08-16Move `DataFlowState::{each_bit,interpret_set}` method definitions to parent ↵Felix S. Klock II-50/+22
module. Refactored `each_bit`, which traverses a `IdxSet`, so that the bulk of its implementation lives in `rustc_data_structures`.
2017-08-16remove now unnecessary constraint on BitDenotation for `fn do_dataflow`.Felix S. Klock II-2/+1
2017-08-16Migrated some code out of `dataflow::drop_flag_effects` and into its parent ↵Felix S. Klock II-74/+71
module. (This code is more general purpose than just supporting drop flag elaboration.)
2017-08-16Added dataflow analysis for `Borrows`.Felix S. Klock II-1/+187
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`.
2017-08-16Refactor `trait BitDenotation` to take `Location` instead of ↵Felix S. Klock II-38/+27
`BasicBlock`/`usize` argument pairs.
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-17/+17
Like #43008 (f668999), but _much more aggressive_.
2017-08-14Merge remote-tracking branch 'origin/master' into genAlex Crichton-4/+4
2017-08-12Fix some typosBastien Orivel-3/+3
2017-08-12Auto merge of #43794 - Eijebong:fix_typos, r=lukaramu,steveklanik,imperiobors-1/+1
Fix some typos I wrote a really naive script and found those typos in the documentation.
2017-08-12Merge branch 'master' of https://github.com/rust-lang/rust into genJohn Kåre Alsaker-17/+47
# Conflicts: # src/librustc_mir/build/scope.rs
2017-08-11Fix some typosBastien Orivel-1/+1
2017-08-10For box expressions, use NZ drop instead of a free blockAriel Ben-Yehuda-17/+47
This falls naturally out of making drop elaboration work with `box` expressions, which is probably required for sane MIR borrow-checking. This is a pure refactoring with no intentional functional effects.
2017-08-09Merge remote-tracking branch 'origin/master' into genAlex Crichton-2/+12
2017-07-30add new instructions for asserting when values are valid, and to describe ↵Ralf Jung-0/+3
when we can rely on them being locked in memory
2017-07-28Remove support for `gen arg`Alex Crichton-6/+0
2017-07-28Rename suspend to yieldJohn Kåre Alsaker-4/+4
2017-07-28Generator literal supportJohn Kåre Alsaker-0/+17
2017-07-27erase types in the move-path abstract domainAriel Ben-Yehuda-2/+9
Leaving types unerased would lead to 2 types with a different "name" getting different move-paths, which would cause major brokenness (see e.g. #42903). This does not fix any *known* issue, but is required if we want to use abs_domain with non-erased regions (because the same can easily have different names). cc @RalfJung.
2017-07-26Rollup merge of #42959 - SimonSapin:nonzero-checked, r=sfacklerMark Simulacrum-1/+1
Make the "main" constructors of NonZero/Shared/Unique return Option Per discussion in https://github.com/rust-lang/rust/issues/27730#issuecomment-303939441. This is a breaking change to unstable APIs. The old behavior is still available under the name `new_unchecked`. Note that only that one can be `const fn`, since `if` is currently not allowed in constant contexts. In the case of `NonZero` this requires adding a new `is_zero` method to the `Zeroable` trait. I mildly dislike this, but it’s not much worse than having a `Zeroable` trait in the first place. `Zeroable` and `NonZero` are both unstable, this can be reworked later.
2017-07-23Fix some doc/comment typos.Bruce Mitchener-1/+1
2017-07-22Use checked NonZero constructor in MIR move path indicesSimon Sapin-1/+1
… to protect against UB in the unlikely case that `idx + 1` overflows.
2017-07-22Rename {NonZero,Shared,Unique}::new to new_uncheckedSimon Sapin-1/+1
2017-06-28Shift mir-dataflow from `rustc_borrowck` to `rustc_mir` crate.Felix S. Klock II-0/+2348
Turn `elaborate_drops` and `rustc_peek` implementations into MIR passes that also live in `rustc_mir` crate. Rewire things so `rustc_driver` uses the `ElaborateDrops` from `rustc_mir` crate.