]> git.lizzy.rs Git - rust.git/commit
Auto merge of #53671 - RalfJung:miri-refactor, r=oli-obk
authorbors <bors@rust-lang.org>
Wed, 29 Aug 2018 00:02:37 +0000 (00:02 +0000)
committerbors <bors@rust-lang.org>
Wed, 29 Aug 2018 00:02:37 +0000 (00:02 +0000)
commitf1d02c307348057fd0554ad934006b186f8b6826
tree0ed67d0fa7379a89dba8bc8afbcc35f8d0b4c503
parent7061b2775782bb48c0a70d3c79ec711134396687
parentc9b5fac7da34eaf027ba5dc62b5f7f9605e0b2e9
Auto merge of #53671 - RalfJung:miri-refactor, r=oli-obk

Miri engine cleanup

* Unify the two maps in memory to store the allocation and its kind together.
* Share the handling of statics between CTFE and miri: The miri engine always
      uses "lazy" `AllocType::Static` when encountering a static.  Acessing that
      static invokes CTFE (no matter the machine).  The machine only has any
      influence when writing to a static, which CTFE outright rejects (but miri
      makes a copy-on-write).
* Add an `AllocId` to by-ref consts so miri can use them as operands without
      making copies.
* Move responsibilities around for the `eval_fn_call` machine hook: The hook
      just has to find the MIR (or entirely take care of everything); pushing the
      new stack frame is taken care of by the miri engine.
* Expose the intrinsics and lang items implemented by CTFE so miri does not
      have to reimplement them.
* Allow Machine to hook into foreign statics (used by miri to get rid of some other hacks).
* Clean up function calling.
* Switch const sanity check to work on operands, not mplaces.
* Move const_eval out of rustc_mir::interpret, to make sure that it does not access private implementation details.

In particular, we can finally make `eval_operand` take `&self`. :-)

Should be merged after https://github.com/rust-lang/rust/pull/53609, across which I will rebase.
src/librustc_lint/builtin.rs
src/librustc_mir/lib.rs
src/librustc_mir/monomorphize/collector.rs