about summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2019-04-14Rollup merge of #59796 - oli-obk:const_arg_ice, r=eddybMazdak Farrokhzad-45/+51
Retire `IsNotConst` naming This naming scheme caused a lot of confusion lately (including ICEs) due to misrefactored code. Also clean up the initialization code for said flag. r? @eddyb previous discussions: https://github.com/rust-lang/rust/pull/58784#issuecomment-468717439 https://github.com/rust-lang/rust/pull/58403#discussion_r265936336
2019-04-12Auto merge of #59536 - Zoxc:the-arena, r=eddybbors-3/+2
Introduce an arena type which may be used to allocate a list of types with destructors You can also specify that you want deserializers for `&'tcx [T]` and `&'tcx T` for a type in the list, which will allocate those using the arena. Based on https://github.com/rust-lang/rust/pull/59517 and https://github.com/rust-lang/rust/pull/59533. Look at the last commit for the interesting changes. An alternative to https://github.com/rust-lang/rust/pull/56448. cc @michaelwoerister @eddyb r? @oli-obk
2019-04-10Documentation should have proper grammarOliver Scherer-3/+6
2019-04-08Elaborate on implicit promotabilityOliver Scherer-1/+4
2019-04-08Pacify tidyOliver Scherer-2/+5
2019-04-08Get rid of "is not const" namingOliver Scherer-16/+16
2019-04-08Explicit promotion is indistinguishable from explicit promotionOliver Scherer-10/+8
Implicit promotion on the other hand has very strict rules on what may be done
2019-04-08Generalize initial "not const" assignmentsOliver Scherer-23/+23
2019-04-08`asm!` output can neither be promotable nor constOliver Scherer-1/+0
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-05Add DropArena and use it to allocate types with few allocationsJohn Kåre Alsaker-3/+2
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-03Improve wordingYuki OKUSHI-1/+1
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