about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
AgeCommit message (Collapse)AuthorLines
2019-12-03Check intrinsics for callability in const fnsMahmut Bulut-63/+66
2019-12-02Auto merge of #64736 - Nashenas88:mir_predecessors_cache_cleanup, r=oli-obkbors-3/+3
Remove interior mutability in mir predecessors cache
2019-12-02Fix remaining compilation issuesPaul Daniel Faria-2/+2
2019-12-02Simplify BodyCache impl and fix all remaining type errors in librustc_mir ↵Paul Daniel Faria-3/+3
(lifetime errors still exist)
2019-12-02Auto merge of #66874 - RalfJung:miri-assert-panic, r=oli-obkbors-114/+141
Miri engine: proper support for `Assert` MIR terminators This puts down the basis for https://github.com/rust-lang/miri/issues/1070, and I also did some clean-up. The Miri side of this is at https://github.com/rust-lang/miri/pull/1084. r? @oli-obk
2019-12-02Rollup merge of #66827 - RalfJung:miri-missing-ret-place, r=oli-obkRalf Jung-15/+23
handle diverging functions forwarding their return place Fixes https://github.com/rust-lang/miri/issues/1075: the shim around diverging closures turned into function pointers actually "obtains" a return place inside a diverging function, but just uses it as the return place for a diverging callee. Handle this by using NULL places. This is kind of a hack as it breaks our invariant that all places are dereferencable, but we'd eventually let raw pointers break that anyway I assume so that seems fine. r? @oli-obk
2019-12-02fix init_allocation_extraRalf Jung-16/+26
2019-12-02fat -> wideRalf Jung-6/+6
2019-12-02make alloc_extra machine hook a bit nicerRalf Jung-11/+15
2019-12-02add and use helper method to get SourceInfo of current instruction in frameRalf Jung-14/+22
2019-12-02Miri: add helper fn to allocate string; simplify alloc_caller_locationRalf Jung-32/+35
2019-12-02Add From instances for Pointer -> ScalarMaybeUndef and Pointer -> ImmediateRalf Jung-7/+14
2019-12-02expose span to M::assert_panic, and provide helper to turn that into ↵Ralf Jung-10/+18
CallerLocation
2019-12-02Miri: add machine hook for MIR-level assertion panicsRalf Jung-38/+25
2019-12-02Rollup merge of #66789 - eddyb:mir-source-scope-local-data, r=oli-obkMazdak Farrokhzad-2/+2
rustc: move mir::SourceScopeLocalData to a field of SourceScopeData. By having one `ClearCrossCrate<SourceScopeLocalData>` for each scope, as opposed to a single `ClearCrossCrate` for all the `SourceScopeLocalData`s, we can represent the fact that some scopes have `SourceScopeLocalData` associated with them, and some don't. This is useful when doing MIR inlining across crates, because the `ClearCrossCrate` will be `Clear` for the cross-crate MIR scopes and `Set` for the local ones. Also see https://github.com/rust-lang/rust/pull/66203#issuecomment-555589574 for some context around this approach. Fixes #51314.
2019-12-01Miri core engine: use throw_ub instead of throw_panicRalf Jung-8/+6
2019-11-30`find_fn` -> `find_mir_or_eval_fn` renameOliver Scherer-2/+2
2019-11-29Use recursion_limit for const eval stack limitcad97-1/+1
2019-11-30rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.Eduard-Mihai Burtescu-1/+1
2019-11-30rustc: move MIR source_scope_local_data's ClearCrossCrate to be around elements.Eduard-Mihai Burtescu-2/+2
2019-11-29Rollup merge of #66844 - RalfJung:caller-location-leak, r=oli-obkRalf Jung-5/+9
Miri: do not consider memory allocated by caller_location leaked Fixes https://github.com/rust-lang/miri/issues/1071 r? @oli-obk I am not sure if this is the best approach, but it certainly is the easiest.
2019-11-29Auto merge of #66321 - ninjasource:async-fn-resume-after-completion, r=oli-obkbors-2/+4
Async fn resume after completion #65419 -- Attempting to run an async fn after completion mentions generators Not yet ready for review - work in progress Just need to run the tests on a proper build server
2019-11-29Only memoize const fn calls during const evalOliver Scherer-13/+1
Miri and other engines may want to execute the function in order to detect UB inside of them.
2019-11-28do not consider memory allocated by caller_location leakedRalf Jung-5/+9
2019-11-28Fixed tidy errorsDavid Haig-2/+4
2019-11-28Remove duplication using single variant for errorDavid Haig-4/+2
2019-11-28SquashDavid Haig-0/+2
2019-11-28Auto merge of #66294 - davidhewitt:const_fn_memoization, r=oli-obkbors-1/+32
Add memoization for const function evaluations When a const function is being evaluated, as long as all its arguments are zero-sized-types (or it has no arguments) then we can trivially memoize the evaluation result using the existing query mechanism. With thanks to @oli-obk for mentoring me through this at RustFest Barcelona. r? @oli-obk
2019-11-27commentRalf Jung-0/+7
2019-11-27handle diverging functions forwarding their return placeRalf Jung-15/+16
2019-11-27Rollup merge of #66798 - bwignall:typo, r=varkorTyler Mandry-1/+1
Fix spelling typos Should be non-semantic. Uses https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines to find likely typos.
2019-11-27Add memoization for const function evaluationsDavid Hewitt-1/+32
When a const function is being evaluated, as long as all its arguments are zero-sized-types (or it has no arguments) then we can trivially memoize the evaluation result using the existing query mechanism.
2019-11-27Auto merge of #66677 - wesleywiser:fix_const_prop_alloc_id_ice, r=oli-obkbors-24/+33
[const prop] Fix "alloc id without corresponding allocation" ICE r? @oli-obk
2019-11-26Fix spelling typosBrian Wignall-1/+1
2019-11-27Auto merge of #66794 - tmandry:rollup-99qrpr0, r=tmandrybors-13/+18
Rollup of 14 pull requests Successful merges: - #66128 (alloc: Add new_zeroed() versions like new_uninit().) - #66661 (Add riscv64gc-unknown-linux-gnu target) - #66663 (Miri: print leak report even without tracing) - #66711 (Add hardware floating point features to aarch64-pc-windows-msvc) - #66713 (introduce a target to build the kernel of the unikernel HermitCore) - #66717 (tidy: Accommodate rustfmt's preferred layout of stability attributes) - #66719 (Store pointer width as u32 on Config) - #66720 (Move ErrorReported to rustc_errors) - #66737 (Error codes cleanup) - #66754 (Various tweaks to diagnostic output) - #66763 (Minor edit for documentation-tests.md that increases clarity) - #66779 (follow the same function order in the trait) - #66786 (Add wildcard test for const_if_match) - #66788 (Allow `Unreachable` terminators through `min_const_fn` checks) Failed merges: r? @ghost
2019-11-26Rollup merge of #66663 - RalfJung:miri-leaks, r=oli-obkTyler Mandry-13/+18
Miri: print leak report even without tracing Currently, the rustup-installed Miri has no way to actually print a leak report (as `trace!` is compiled out). Make it print that per default instead when there is a leak. r? @oli-obk
2019-11-26Auto merge of #66646 - RalfJung:unwind_to_block, r=oli-obkbors-120/+126
refactor goto_block and also add unwind_to_block r? @oli-obk
2019-11-26Show the sign of signed interpreter valuesOliver Scherer-3/+40
2019-11-25make sure we handle all transmute invocations, including diverging onesRalf Jung-3/+7
2019-11-25miri: couple ret place and ret block together (they both exist or both don't)Ralf Jung-52/+55
2019-11-25move ABI check out to cover all callsRalf Jung-24/+24
2019-11-25unify call_intrinsic handling of intruction pointer with other machine hooksRalf Jung-23/+5
2019-11-25refactor goto_block and also add unwind_to_blockRalf Jung-20/+37
2019-11-25Auto merge of #66279 - cjgillot:hashstable, r=Zoxcbors-12/+20
Use proc-macro to derive HashStable everywhere Hello, A second proc-macro is added to derive HashStable for crates librustc depends on. This proc-macro `HashStable_Generic` (to bikeshed) allows to decouple code and strip much of librustc's boilerplate. Still, two implementations `Span` and `TokenKind` require to be placed in librustc. The latter only depends on the `bug` macro. Advise welcome on how to sever that link. A trait `StableHasingContextLike` has been introduced at each crate root, in order to handle those implementations which require librustc's very `StableHashingContext`. This overall effort allowed to remove the `impl_stable_hash_for` macro. Each commit passes the `x.py check`. I still have to double check there was no change in the implementation.
2019-11-24Respond to CR feedbackWesley Wiser-62/+11
2019-11-23only print LEAK REPORT if there is a leakRalf Jung-2/+4
2019-11-23Miri: print leak report even without tracingRalf Jung-12/+15
2019-11-22Allow miri allocation interning to work im generic MachinesWesley Wiser-26/+86
This is necessary so that the `ComstPropMachine` can intern allocations.
2019-11-22Revert "Revert expansion of impl HashStable for Frame."Camille GILLOT-12/+20
This reverts commit 579625b9e738e606b91fa315c75ab4909fa090be.
2019-11-22fix reoccuring typo: dereferencable -> dereferenceableRalf Jung-5/+5