summary refs log tree commit diff
path: root/src/librustc_mir/dataflow/move_paths
AgeCommit message (Collapse)AuthorLines
2019-06-25Implement From<Local> for Place and PlaceBaseSantiago Pastorino-3/+3
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-2/+2
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-15/+15
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-3/+5
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-4/+4
2019-06-12Fix fallout from `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-2/+2
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-4/+4
2019-06-09Changed usages of `mir` in librustc::mir and librustc_mir to `body`Jad Ghalayini-22/+22
2019-05-28Changes the type `mir::Mir` into `mir::Body`Claude-Alban RANÉLY-VERGÉ-DÉPRÉ-6/+6
The commit should have changed comments as well. At the time of writting, it passes the tidy and check tool. Revisions asked by eddyb : - Renamed of all the occurences of {visit/super}_mir - Renamed test structures `CachedMir` to `Cached` Fixing the missing import on `AggregateKind`
2019-05-26Make move_path_for iterate instead of recurseSantiago Pastorino-14/+27
2019-05-25Inline move_path_for_projection inside move_path_forSantiago Pastorino-61/+53
2019-05-25Auto merge of #61151 - Centril:rollup-5rpyhfo, r=Centrilbors-13/+14
Rollup of 6 pull requests Successful merges: - #61092 (Make sanitize_place iterate instead of recurse) - #61093 (Make borrow_of_local_data iterate instead of recurse) - #61094 (Make find_local iterate instead of recurse) - #61099 (Make ignore_borrow iterate instead of recurse) - #61103 (Make find iterate instead of recurse) - #61104 (Make eval_place_to_op iterate instead of recurse) Failed merges: r? @ghost
2019-05-24Make find iterate instead of recurseSantiago Pastorino-13/+14
2019-05-24Make place projections concrete.Edd Barrett-1/+1
Once upon a time (commit 9bd35c07c26) there were two kinds of projection: one for places, and one for constants. It therefore made sense to share the `Projection` struct for both. Although the different use-cases used different concrete types, sharing was made possible by type-parameterisation of `Projection`. Since then, however, the usage of projections in constants has disappeared, meaning that (forgetting lifetimes for a moment) the parameterised type is only every instantiated under one guise. So it may as well be a concrete type.
2019-04-28Fix lint findings in librustc_mirflip1995-3/+3
2019-04-13Auto merge of #59612 - matthewjasper:dataflow-usual-newtype-index, r=estebankbors-57/+14
Use normal newtype_index macro for MIR dataflows * Makes the definition of these structs contain `struct IndexName` * Avoids having an offset by removing high values, rather than 0 * Implements some traits for us.
2019-04-03Deny internal lints on librustc_mirflip1995-1/+1
2019-04-03Rollup merge of #59630 - nnethercote:shrink-mir-Statement, r=pnkfelixMazdak Farrokhzad-3/+3
Shrink `mir::Statement`. The `InlineAsm` variant is extremely rare, and `mir::Statement` often contributes significantly to peak memory usage.
2019-04-03Shrink `mir::Statement`.Nicholas Nethercote-3/+3
The `InlineAsm` variant is extremely rare, and `mir::Statement` often contributes significantly to peak memory usage.
2019-04-02Remove adt_def from PlaceTy and make it a structTyler Mandry-2/+2
2019-04-02Replace adt_def with name in mir::ProjectionElem::DowncastTyler Mandry-8/+7
2019-04-01Use normal newtype_index macro for MIR dataflowMatthew Jasper-57/+14
2019-03-18promoted is still left in 2 placesSaleem Jaffer-2/+0
2019-03-08expand unused doc comment diagnosticAndy Russell-12/+24
Report the diagnostic on macro expansions, and add a label indicating why the comment is unused.
2019-03-01Put Local, Static and Promoted as one Base variant of PlaceSantiago Pastorino-11/+11
2019-02-10rustc: doc commentsAlexander Regueiro-5/+5
2019-02-08librustc_mir => 2018Taiki Endo-8/+11
2018-12-25Remove licensesMark Rousskov-31/+0
2018-12-18treat ref-to-raw cast like a reborrow: do a special kind of retagRalf Jung-1/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-01remove some uses of try!Mark Mansi-1/+1
2018-11-18Remove mir::StatementKind::EndRegionMatthew Jasper-1/+0
Since lexical MIR borrow check is gone, and validation no longer uses these, they can be removed.
2018-11-15Auto merge of #55716 - RalfJung:escape-to-raw, r=oli-obkbors-1/+2
Add escape-to-raw MIR statement Add a new MIR "ghost state statement": Escaping a ptr to permit raw accesses. ~~This includes #55549, [click here](https://github.com/RalfJung/rust/compare/miri-visitor...RalfJung:escape-to-raw) for just the new commits.~~
2018-11-11Auto merge of #55657 - davidtwco:issue-55651, r=pnkfelixbors-0/+14
NLL Diagnostic Review 3: Unions not reinitialized after assignment into field Fixes #55651, #55652. This PR makes two changes: First, it updates the dataflow builder to add an init for the place containing a union if there is an assignment into the field of that union. Second, it stops a "use of uninitialized" error occuring when there is an assignment into the field of an uninitialized union that was previously initialized. Making this assignment would re-initialize the union, as tested in `src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr`. The check for previous initialization ensures that we do not start supporting partial initialization yet (cc #21232, #54499, #54986). This PR also fixes #55652 which was marked as requiring investigation as the changes in this PR add an error that was previously missing (and mentioned in the review comments) and confirms that the error that was present is correct and a result of earlier partial initialization changes in NLL. r? @pnkfelix (due to earlier work with partial initialization) cc @nikomatsakis
2018-11-07no more action on ref or cast, but add new MIR statement for escaping a ptr ↵Ralf Jung-1/+2
to raw
2018-11-03Unions reinitialized after assignment into field.David Wood-0/+14
This commit makes two changes: First, it updates the dataflow builder to add an init for the place containing a union if there is an assignment into the field of that union. Second, it stops a "use of uninitialized" error occuring when there is an assignment into the field of an uninitialized union that was previously initialized. Making this assignment would re-initialize the union, as tested in `src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr`. The check for previous initialization ensures that we do not start supporting partial initialization yet (cc #21232, #54499, #54986).
2018-11-02Auto merge of #55087 - levex:e0669-improve-span, r=nagisabors-1/+1
rustc: improve E0669 span E0669 refers to an operand that cannot be coerced into a single LLVM value, unfortunately right now this uses the Span for the entire inline assembly statement, which is less than ideal. This commit preserves the Span from HIR, which lets us emit the error using the Span for the operand itself in MIR. r? @nagisa cc/ @parched
2018-11-02Auto merge of #55316 - RalfJung:retagging, r=oli-obkbors-1/+1
Add Retagging statements This adds a `Retag` statement kind to MIR, used to perform the retagging operation from [Stacked Borrows](https://www.ralfj.de/blog/2018/08/07/stacked-borrows.html). It also kills the old `Validate` statements that I added last year. NOTE: This includes https://github.com/rust-lang/rust/pull/55270. Only [these commits are new](https://github.com/RalfJung/rust/compare/stacked-borrows-ng...RalfJung:retagging).
2018-11-01Use `SmallVec` within `MoveData`.Nicholas Nethercote-9/+10
This reduces allocation counts significantly in a few benchmarks, reducing instruction counts by up to 2%.
2018-10-29Emit Retag statements, kill Validate statementsRalf Jung-1/+1
Also "rename" -Zmir-emit-validate to -Zmir-emit-retag, which is just a boolean (yes or no).
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-2/+1
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-1/+1
2018-10-17rustc: improve E0669 spanLevente Kurusa-1/+1
E0669 refers to a constraint that cannot be coerced into a single LLVM value, unfortunately right now this uses the Span for the entire inline assembly statement, which is less than ideal. This commit preserves the Span from HIR, which lets us emit the error using the Span for the operand itself in MIR. Signed-off-by: Levente Kurusa <lkurusa@acm.org>
2018-10-03Record whether a Call in MIR corresponds to a call in HIRMatthew Jasper-1/+7
2018-09-24Shrink StatementKind::InlineAsm.Nicholas Nethercote-1/+1
This shrinks StatementKind from 64 bytes to 48 bytes on 64-bit.
2018-09-22Auto merge of #54188 - lqd:fallout-53695, r=nikomatsakisbors-1/+1
NLL: disallow creation of immediately unusable variables Fix #53695 Original description follows ---- This WIP PR is for discussing the impact of fixing #53695 by injecting a fake read in let patterns. (Travis will fail, at least the `mir-opt` suite is failing in its current state)
2018-09-18Refactor 'ReadForMatch' into 'FakeRead' and add the cause of the fake readRemy Rakic-1/+1
2018-09-17Inspect parents paths when checking for movesSantiago Pastorino-0/+14
2018-09-10add the `AscribeUserType` statement kindNiko Matsakis-1/+1
Make it have the semantics of subtype.
2018-09-08Auto merge of #53909 - mikhail-m1:53643, r=nikomatsakisbors-0/+10
Skip a shared borrow of a immutable local variables issue #53643 r? @nikomatsakis