summary refs log tree commit diff
path: root/src/librustc_mir/dataflow/move_paths
AgeCommit message (Collapse)AuthorLines
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-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
2018-09-07Auto merge of #54021 - kennytm:rollup, r=kennytmbors-1/+1
Rollup of 17 pull requests Successful merges: - #53299 (Updated core/macros.rs to note it works in a no_std environment.) - #53376 (Cross reference io::copy and fs::copy in docs.) - #53455 (Individual docs for {from,to}_*_bytes) - #53550 (librustc_lint: In recursion warning, change 'recurring' to 'recursing') - #53860 (Migrate (some) of run-pass/ to ui) - #53874 (Implement Unpin for Box, Rc, and Arc) - #53895 (tidy: Cleanups and clippy warning fixes) - #53946 (Clarify `ManuallyDrop` docs) - #53948 (Minimized clippy test from when NLL disabled two-phase borrows) - #53959 (Add .git extension to submodule paths missing it) - #53966 (A few cleanups and minor improvements to mir/dataflow) - #53967 (propagate build.python into cmake) - #53979 (Remove `#[repr(transparent)]` from atomics) - #53991 (Add unchecked_shl/shr check for intrinsics to fix miri's test suit) - #53992 (migrate run-pass/borrowck to ui/run-pass) - #53994 (migrate run-pass/*/ to ui/run-pass) - #54023 (update clippy submodule)
2018-09-06Skip a shared borrow of a immutable local variablesMikhail Modin-0/+10
issue #53643
2018-09-05A few cleanups and minor improvements to mir/dataflowljedrz-1/+1
2018-08-30Added InitLocation to encode Location or Local depending on source of InitDavid Wood-7/+24
2018-08-22Remove Ty prefix from ↵varkor-5/+5
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2018-08-14Label definition of captured variables in errors.David Wood-7/+10
2018-07-23Promoteds are statics and statics have a place, not just a valueOliver Schneider-0/+2
2018-07-21Add specific message when moving from upvars in a non-FnOnce closureMatthew Jasper-5/+5
2018-06-27Group move errors before reporting, add suggestionsMatthew Jasper-11/+10
2018-06-06When NLL has illegal move due to borrowed content, provide feedback about ↵Felix S. Klock II-5/+20
why the move wasn't a copy. This should address #51190.
2018-05-29rust-lang/rust#27282: Add `StatementKind::ReadForMatch` to MIR.Felix S. Klock II-0/+3
(This is just the data structure changes and some boilerplate match code that followed from it; the actual emission of these statements comes in a follow-up commit.)
2018-05-24Use AllFacts from polonius-engineSantiago Pastorino-1/+1
2018-04-15remove `ReserveOrActivateIndex`Niko Matsakis-3/+0
2018-03-24Auto merge of #48482 - davidtwco:issue-47184, r=nikomatsakisbors-0/+1
NLL should identify and respect the lifetime annotations that the user wrote Part of #47184. r? @nikomatsakis
2018-03-22Added UserAssertTy statement.David Wood-0/+1
2018-03-17Use num::NonZero* instead of NonZero<_> in rustc and testsSimon Sapin-3/+3
2018-02-15mir: Gather move at SwitchInt, Assert terminatorsFederico Poli-3/+6
Previously, "_1" was not marked as "definitely uninitialized" after a "switchInt(move _1)" terminator. Related discussion: https://internals.rust-lang.org/t/why-is-2-definitely-initialized-after-switchint-move-2/6760