about summary refs log tree commit diff
path: root/src/librustc_mir/dataflow
AgeCommit message (Collapse)AuthorLines
2017-11-27Add initialization info to `MoveData`Matthew Jasper-97/+299
* Used for new dataflow to track if a variable has every been initialized * Used for other dataflows that need to be updated for initializations
2017-11-24Kill the storage for all locals on returning terminatorsKeith Yeung-0/+29
2017-11-18Auto merge of #46032 - KiChjang:ignore-borrowck-statics, r=nikomatsakisbors-8/+50
Ignore borrowck for static lvalues and allow assignment to static muts Fixes #45129. Fixes #45641.
2017-11-17Do not registor borrows for unsafe lvaluesKeith Yeung-8/+50
2017-11-16replace `RegionIndex` with `RegionVid` (which now impls Idx)Niko Matsakis-2/+2
2017-11-15fix comment, remove redundant codeMikhail Modin-19/+5
2017-11-15add `StorageDead` handlingMikhail Modin-15/+29
2017-11-15Auto merge of #45922 - vramana:fix-45702, r=nikomatsakisbors-5/+11
Fix MIR borrowck EndRegion not found Fixes #45702 - [x] Add Tests
2017-11-13Use the correct type for cannot move errormatthewjasper-8/+7
2017-11-11Fix MIR borrowck EndRegion not foundRamana Venkata-5/+11
Updated tests Fixes #45702
2017-11-09Add `TerminatorKind::DropAndReplace` handlingMikhail Modin-0/+13
2017-11-08restore move out dataflow, add report of move out errorsMikhail Modin-2/+162
2017-11-06Auto merge of #45668 - nikomatsakis:nll-free-region, r=arielb1bors-7/+17
extend NLL with preliminary support for free regions on functions This PR extends https://github.com/rust-lang/rust/pull/45538 with support for free regions. This is pretty preliminary and will no doubt want to change in various ways, particularly as we add support for closures, but it's enough to get the basic idea in place: - We now create specific regions to represent each named lifetime declared on the function. - Region values can contain references to these regions (represented for now as a `BTreeSet<RegionIndex>`). - If we wind up trying to infer that `'a: 'b` must hold, but no such relationship was declared, we report an error. It also does a number of drive-by refactorings. r? @arielb1 cc @spastorino
2017-11-02encapsulate the `Region` struct within region inferenceNiko Matsakis-5/+15
2017-11-02extend NLL regions to include free region indices and add outlivesNiko Matsakis-3/+3
2017-11-02add TerminatorKind::FalseEdges and use it in matchesMikhail Modin-0/+7
2017-10-31connect MIR borrowck with NLLNiko Matsakis-6/+34
2017-10-31make the dataflow / mir-borrowck types carry a `'tcx` lifetimeNiko Matsakis-92/+92
Also, factor out `do_mir_borrowck`, which is the code that actually performs the MIR borrowck from within the scope of an inference context. This change should be a pure refactoring.
2017-10-31test "needs drop" on region-erased, lifted typesNiko Matsakis-3/+9
This will be important in next commit, since the input types will be tagged not with `'gcx` but rather `'tcx`. Also, using the region-erased, lifted types enables better caching.
2017-10-31make end-point optional in the borrow checkNiko Matsakis-2/+5
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