summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2019-04-07Update commentOliver Scherer-1/+1
2019-04-07Add more regression tests for accidental promotionOliver Scherer-2/+2
2019-04-07Function arguments should never get promotedOliver Scherer-1/+1
2019-04-04Fix cases of conflicting two-phase borrowsMatthew Jasper-3/+3
2019-04-03Deny internal lints on librustc_mirflip1995-5/+5
2019-04-03Rollup merge of #59514 - tmandry:remove-adt-def-from-projection-elem, r=eddybMazdak Farrokhzad-24/+23
Remove adt_def from projections and downcasts in MIR As part of optimizing generator layouts in MIR, we'd like to allow downcasting generators to variants which do not have a corresponding `def_id`, since they are created by the compiler. This refactor hopes to allow that, without regressing perf. r? @eddyb
2019-04-02Remove adt_def from PlaceTy and make it a structTyler Mandry-24/+23
2019-04-02Rollup merge of #59607 - kenta7777:renames-EvalErrorKind-to-InterpError, ↵Mazdak Farrokhzad-5/+5
r=oli-obk Renames `EvalErrorKind` to `InterpError` This PR renames `EvalErrorKind` to `InterpError`. This is related to #54395.
2019-04-02Rollup merge of #59585 - rust-lang:shallow-borrow-fixes, r=pnkfelixMazdak Farrokhzad-1/+4
Fixes for shallow borrows * Don't promote these borrows if we're going to remove them before codegen * Correctly mark unreachable code
2019-04-02renames EvalErrorKind to InterpErrorkenta7777-5/+5
2019-04-01Allow closure to unsafe fn coercionTaiki Endo-2/+2
2019-03-31Fixes for shallow borrowsMatthew Jasper-1/+4
* Don't promote these borrows if we're going to remove them before codegen * Correctly mark unreachable code
2019-03-29rustc(codegen): uncache `def_symbol_name` prefix from `symbol_name`.Eduard-Mihai Burtescu-1/+1
2019-03-27Rollup merge of #59430 - kenta7777:rename-evalcontext-to-interpretcx, r=oli-obkJosh Stone-2/+2
Renames `EvalContext` to `InterpretCx` This PR renames `EvalContext` to `InterpretCx` in `src/librustc_mir`. This PR is related to #54395 .
2019-03-26Rollup merge of #59232 - saleemjaffer:mir_place_refactor, r=oli-obkMazdak Farrokhzad-27/+45
Merge `Promoted` and `Static` in `mir::Place` fixes #53848
2019-03-26renames EvalContext to InterpretCx.kenta7777-2/+2
2019-03-24Rollup merge of #59251 - matthewjasper:fix-graphviz, r=petrochenkovkennytm-19/+18
Use a valid name for graphviz graphs Hiridification has broken graphviz output because `HirId` has a more complex display implemetation than `NodeId`. Since the id was just used to generate a distinct identifier, we just pull out the various constituent indexed.
2019-03-24code review fixesSaleem Jaffer-3/+4
2019-03-23Swap const evaluation lint spans to point at problem in primary spanEsteban Küber-0/+1
2019-03-23adding mir::StaticKind enum for static and promotedSaleem Jaffer-31/+42
2019-03-21review fixesSaleem Jaffer-18/+10
2019-03-21Auto merge of #58902 - matthewjasper:generator-cleanup-blocks, r=davidtwcobors-37/+42
Fixes for the generator transform * Moves cleanup annotations in pretty printed MIR so that they can be tested * Correctly determines which drops are in cleanup blocks when elaborating generator drops * Use the correct state for poisoning a generator Closes #58892
2019-03-20remove visit_static from librustc::mirSaleem Jaffer-7/+4
2019-03-19Run branch cleanup after copy propOliver Scherer-0/+1
2019-03-18fixed all compilation errorsSaleem Jaffer-7/+17
2019-03-18cleaner code as per reviewSaleem Jaffer-111/+91
2019-03-18promoted is still left in 2 placesSaleem Jaffer-104/+131
2019-03-17Use a valid name for graphviz graphsMatthew Jasper-19/+18
2019-03-16Revert the `LazyConst` PROliver Scherer-13/+14
2019-03-15rustc: rename item_path to def_path (except the module in ty).Eduard-Mihai Burtescu-3/+3
2019-03-11Auto merge of #58784 - oli-obk:accidental_promotion, r=eddybbors-5/+4
Don't promote function calls to nonpromotable things fixes https://github.com/rust-lang/rust/issues/58767 and fixes https://github.com/rust-lang/rust/issues/58634 r? @eddyb should we additionally check the function call return type? It might be a promotable function (or any `const fn` inside a `const fn`), but its return type might contain interior mutability.
2019-03-07HirIdification: replace NodeId method callsljedrz-17/+20
2019-03-05Handle new ConstValue variants in mirvarkor-3/+4
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-03Auto merge of #58505 - schomatis:fix/nll/remove-live-var, r=matthewjasperbors-9/+7
[NLL] Remove `LiveVar` The `LiveVar` type (and related) made it harder to reason about the code. It seemed as an abstraction that didn't bring any useful concept to the reader (when transitioning from the RFC theory to the actual implementation code). It achieved a compactness in the vectors storing the def/use/drop information that was related only to the `LocalUseMap`. This PR went in the other direction and favored time over memory (but this decision can be easily reverted to the other side without reintroducing `LiveVar`). What this PR aims at is to clarify that there's no significant transformation between the MIR `Local` and the `LiveVar` (now refactored as `live_locals: Vec<Local>`): we're just filtering (not mapping) the entire group of `Local`s into a meaningful subset that we should perform the liveness analysis on. As a side note, there is no guarantee that the liveness analysis is performed only on (what the code calls) "live" variables, if the NLL facts are requested it will be performed on *any* variable so there can't be any assumptions on that regard. (Still, this PR didn't change the general naming convention to reduce the number of changes here and streamline the review process). **Acceptance criteria:** This PR attempts to do only a minor refactoring and not to change the logic so it can't have any performance impact, particularly, it can't lose any of the significant performance improvement achieved in the great work done in https://github.com/rust-lang/rust/pull/52115. r? @nikomatsakis
2019-03-03Use the correct state for poisoning a generatorMatthew Jasper-13/+20
2019-03-03Don't incorrectly mark blocks in generator drop shims as cleanupMatthew Jasper-24/+22
This also ensure that dropping a generator won't leak upvars if dropping one of them panics
2019-03-03Auto merge of #58673 - matthewjasper:typeck-ptr-coercions, r=pnkfelixbors-0/+4
[NLL] Type check operations with pointer types It seems these were forgotten about. Moving to `Rvalue::AddressOf` simplifies the coercions from references, but I want this to be fixed as soon as possible. r? @pnkfelix
2019-03-02hir: remove NodeId from VariantDataljedrz-2/+2
2019-03-01Schedule the demolition of `IsNotPromotable`Oliver Scherer-0/+2
2019-03-01Auto merge of #58754 - ljedrz:I_hate_NodeIds, r=Zoxcbors-12/+10
Remove NodeId from more HIR nodes The next iteration of HirIdification (#57578). Removes `NodeId` from: - [x] `Stmt` - [x] `Local` - [x] `Field` - [x] `AnonConst` - [x] `TraitItem` - [x] `ImplItem` - [x] `TypeBinding` - [x] `Arg` - [x] `TraitRef` - [x] `VisibilityKind` It will most probably break clippy again; I'd appreciate a **delegate** again if/when it is good to go so I can attach a clippy fix later. r? @Zoxc
2019-03-01ty: HirIdify some lintsljedrz-12/+10
2019-03-01Put Local, Static and Promoted as one Base variant of PlaceSantiago Pastorino-85/+104
2019-02-27Don't promote function calls to nonpromotable thingsOliver Scherer-5/+2
2019-02-27rename Substs to InternalSubstscsmoe-2/+2
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
2019-02-26replace &'tcx Substs with SubstsRefcsmoe-6/+6
2019-02-26Auto merge of #58561 - ljedrz:HirIdify_some_nodes, r=Zoxcbors-33/+32
Remove NodeId from some HIR nodes The next iteration of https://github.com/rust-lang/rust/pull/57578. Removes `NodeId` from: - [x] `Lifetime` - [x] `Ty` - [x] `GenericParam` - [x] `WhereClause` - [x] `WhereEqPredicate` - [x] `MacroDef` - [x] `Block` - [x] `Expr` r? @Zoxc
2019-02-25Auto merge of #57609 - matthewjasper:more-restrictive-match, r=pnkfelixbors-85/+20
Use normal mutable borrows in matches `ref mut` borrows are currently two-phase with NLL enabled. This changes them to be proper mutable borrows. To accommodate this, first the position of fake borrows is changed: ```text [ 1. Pre-match ] | [ (old create fake borrows) ] [ 2. Discriminant testing -- check discriminants ] <-+ | | | (once a specific arm is chosen) | | | [ (old read fake borrows) ] | [ 3. Create "guard bindings" for arm ] | [ (create fake borrows) ] | | | [ 4. Execute guard code ] | [ (read fake borrows) ] --(guard is false)-----------+ | | (guard results in true) | [ 5. Create real bindings and execute arm ] | [ Exit match ] ``` The following additional changes are made to accommodate `ref mut` bindings: * We no longer create fake `Shared` borrows. These borrows are no longer needed for soundness, just to avoid some arguably strange cases. * `Shallow` borrows no longer conflict with existing borrows, avoiding conflicting access between the guard borrow access and the `ref mut` borrow. There is some further clean up done in this PR: * Avoid the "later used here" note for Shallow borrows (since it's not relevant with the message provided) * Make any use of a two-phase borrow activate it. * Simplify the cleanup_post_borrowck passes into a single pass. cc #56254 r? @nikomatsakis
2019-02-24hir: remove NodeId from Blockljedrz-33/+32
2019-02-24Rollup merge of #58511 - oli-obk:const_to_op, r=RalfJungMazdak Farrokhzad-1/+1
Const to op simplification r? @RalfJung alternative to https://github.com/rust-lang/rust/pull/58486
2019-02-23Type check coercions to pointer typesMatthew Jasper-0/+4