summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2019-08-06Rollup merge of #63299 - spastorino:in-projection-use-ref, r=oli-obkMazdak Farrokhzad-14/+15
Make qualify consts in_projection use PlaceRef r? @oli-obk
2019-08-05Make qualify consts in_projection use PlaceRefSantiago Pastorino-14/+15
2019-08-05Clear the ParamEnv where its information is irrelevantOliver Scherer-1/+1
2019-08-05Fiddle param env through to `try_eval_bits` in most placesOliver Scherer-9/+13
2019-08-05Don't abort on unevaluated constants without at least tryting to eval themOliver Scherer-5/+5
2019-08-05Clean up the `ty::Const::assert*` methodsOliver Scherer-2/+1
2019-08-02be less BritishRalf Jung-1/+1
2019-08-01code review fixesSaleem Jaffer-1/+6
2019-08-01code review fixesSaleem Jaffer-6/+2
2019-07-31code review fixesSaleem Jaffer-2/+2
2019-07-30renaming throw_err_* to throw_*Saleem Jaffer-1/+1
2019-07-30adding throw_ and err_ macros for InterpErrorSaleem Jaffer-1/+1
2019-07-30code review fixesSaleem Jaffer-7/+0
2019-07-29code review fixesSaleem Jaffer-2/+2
2019-07-29use PanicInfo and UnsupportedOpInfoSaleem Jaffer-8/+8
2019-07-29adding a err macro for each of the InterpError variantsSaleem Jaffer-1/+1
2019-07-29tidy fixesSaleem Jaffer-1/+0
2019-07-29fixing fallout due to InterpError refactorSaleem Jaffer-76/+10
2019-07-26Rollup merge of #62801 - bjorn3:remove_lower_128bit_ops, r=alexcrichtonMazdak Farrokhzad-240/+0
Remove support for -Zlower-128bit-ops It is broken and unused cc https://github.com/rust-lang/rust/issues/58969 blocked https://github.com/rust-lang-nursery/compiler-builtins/pull/302 (removes definitions of the lang items removed in this PR) r? @alexcrichton
2019-07-24Stabilize the type_name intrinsic in core::anySteven Fackler-1/+1
Closes rust-lang/rfcs#1428
2019-07-24use PanicMessage type for MIR assertion errorsRalf Jung-12/+9
2019-07-24do not use InterpError::description outside librustc::mirRalf Jung-2/+3
2019-07-23Rollup merge of #62859 - spastorino:rename-to-as-ref, r=CentrilMark Rousskov-12/+12
Place::as_place_ref is now Place::as_ref r? @oli-obk
2019-07-23Rollup merge of #60951 - saleemjaffer:mir_better_error_enum, r=oli-obkMark Rousskov-14/+9
more specific errors in src/librustc/mir/interpret/error.rs Implements [this](https://github.com/rust-rfcs/const-eval/issues/4)
2019-07-23renames EvalErrorPanic to PanicMessageSaleem Jaffer-14/+9
2019-07-23moving some variants from InterpError to EvalErrorPanicSaleem Jaffer-14/+14
2019-07-22Place::as_place_ref is now Place::as_refSantiago Pastorino-12/+12
2019-07-20Avoid cloning Place in check_and_patchSantiago Pastorino-12/+13
2019-07-20Avoid cloning Place in visit_rvalueSantiago Pastorino-4/+4
2019-07-20Avoid cloning Place in assign #2Santiago Pastorino-8/+2
2019-07-20Avoid cloning Place in assign #1Santiago Pastorino-8/+3
2019-07-20Avoid cloning Place in in_projection_structurallySantiago Pastorino-20/+20
2019-07-20Avoid cloning Place in is_stableSantiago Pastorino-5/+6
2019-07-20Avoid cloning Place in report_use_of_moved_or_uninitialized and friendsSantiago Pastorino-8/+8
2019-07-20Migrate from Place enum to Place structSantiago Pastorino-176/+351
2019-07-19Remove support for -Zlower-128bit-opsbjorn3-240/+0
It is broken and unused
2019-07-18Auto merge of #61749 - davidtwco:rfc-2203-const-array-repeat-exprs, r=eddybbors-78/+111
rustc/rustc_mir: Implement RFC 2203. This PR implements RFC 2203, allowing constants in array repeat expressions. Part of #49147. r? @eddyb
2019-07-16Auto merge of #62322 - wesleywiser:promoted_query, r=oli-obkbors-0/+7
Add a query to get the `promoted`s for a `mir::Body` This is a builidng block toward removing a lot of duplicated code between miri and the cosnt-propagator pass. See this thread for more info: https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Using.20.60InterpCx.60.20more/near/169030661 r? @spastorino but feel free to hand it off to somebody else
2019-07-11rustc_mir: follow FalseUnwind's real_target edge in qualify_consts.Eduard-Mihai Burtescu-2/+2
2019-07-10Rollup merge of #62275 - eddyb:const-drop-replace, r=pnkfelixMazdak Farrokhzad-3/+20
rustc_mir: treat DropAndReplace as Drop + Assign in qualify_consts. This slipped through the cracks and never got implemented (thankfully that just meant it was overly conservative and didn't allow assignments that don't *actually* drop the previous value). Fixes #62273. r? @oli-obk
2019-07-07syntax: Add feature gate.David Wood-1/+1
This commit adds a `const_in_array_repeat_expressions` feature gate and only create `Candidate::Repeat` if it is enabled.
2019-07-07rustc/rustc_mir: Implement RFC 2203.David Wood-78/+111
This commit implements RFC 2203, allowing constants in array repeat expressions. Firstly, the check that the array repeat expression implements `Copy` is removed and re-implemented in `rustc_mir::borrow_check::nll::type_check` by emitting an error when the MIR contains a `Operand::Move` and the type does not implement `Copy`. Next, the `qualify_consts` pass is modified to construct a `Candidate::Repeat` when it would be correct to promote a array repeat expression. Finally, the `promote_consts` pass is modified to promote the candidates previously identified.
2019-07-06normalize use of backticks/lowercase in compiler messages for librustc_mirSamy Kacimi-13/+13
https://github.com/rust-lang/rust/issues/60532 r? @alexreg
2019-07-04rename hir::map::local_def_id_from_hir_id to local_def_idljedrz-1/+1
2019-07-04Rollup merge of #62173 - RalfJung:miri-interp, r=oli-obkMazdak Farrokhzad-3/+3
rename InterpretCx -> InterpCx That's more consistent with InterpResult and InterpError. r? @oli-obk
2019-07-03Remove needless lifetimesJeremy Stucki-22/+22
2019-07-02Add a query to get the `promoted`s for a `mir::Body`Wesley Wiser-0/+7
This is a builidng block toward removing a lot of duplicated code between miri and the cosnt-propagator pass. See this thread for more info: https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Using.20.60InterpCx.60.20more/near/169030661
2019-07-02Auto merge of #61922 - tmandry:moar-generator-optimization, r=matthewjasperbors-30/+40
Don't store locals that have been moved from in generators This avoids reserving storage in generators for locals that are moved out of (and not re-initialized) prior to yield points. Fixes #59123. This adds a new dataflow analysis, `RequiresStorage`, to determine whether the storage of a local can be destroyed without being observed by the program. The rules are: 1. StorageLive(x) => mark x live 2. StorageDead(x) => mark x dead 3. If a local is moved from, _and has never had its address taken_, mark it dead 4. If (any part of) a local is initialized, mark it live' This is used to determine whether to save a local in the generator object at all, as well as which locals can be overlapped in the generator layout. Here's the size in bytes of all testcases included in the change, before and after the change: async fn test |Size before |Size after -----------------|------------|---------- single | 1028 | 1028 single_with_noop | 2056 | 1032 joined | 5132 | 3084 joined_with_noop | 8208 | 3084 generator test |Size before |Size after ----------------------------|------------|---------- move_before_yield | 1028 | 1028 move_before_yield_with_noop | 2056 | 1032 overlap_move_points | 3080 | 2056 ## Future work Note that there is a possible extension to this optimization, which modifies rule 3 to read: "If a local is moved from, _**and either has never had its address taken, or is Freeze and has never been mutably borrowed**_, mark it dead." This was discussed at length in #59123 and then #61849. Because this would cause some behavior to be UB which was not UB before, it's a step that needs to be taken carefully. A more immediate priority for me is inlining `std::mem::size_of_val(&x)` so it becomes apparent that the address of `x` is not taken. This way, using `size_of_val` to look at the size of your inner futures does not affect the size of your outer future. cc @cramertj @eddyb @Matthias247 @nikomatsakis @RalfJung @Zoxc
2019-07-02rustc_mir: treat DropAndReplace as Drop + Assign in qualify_consts.Eduard-Mihai Burtescu-3/+20
2019-07-01Clean up extra lifetime, add assertionsTyler Mandry-11/+8