about summary refs log tree commit diff
path: root/src/librustc/mir/interpret
AgeCommit message (Collapse)AuthorLines
2019-09-29Rollup merge of #64858 - skinny121:str-const-generics, r=varkorMazdak Farrokhzad-1/+16
Add support for relating slices in `super_relate_consts` This allows passing strings as generic arguments. Fixes #63773 Fixes #60813 r? @varkor
2019-09-28Move `get_slice_bytes` to `rustc::mir::interpret` so it can be reused.ben-1/+16
2019-09-27Introduce a `ConstPropMachine`Wesley Wiser-12/+0
This allows us to avoid changing things directly in the miri engine just for const prop.
2019-09-27Work around for #64506Wesley Wiser-0/+6
2019-09-27[const-prop] Replace `eval_place()` with use of `InterpCx`Wesley Wiser-0/+12
2019-09-26Rename `subst::Kind` to `subst::GenericArg`varkor-2/+2
2019-09-17Rollup merge of #64503 - RalfJung:miri-retag, r=oli-obkTyler Mandry-2/+2
rename Allocation::retag -> with_tags_and_extra This is more consistent with `Pointer::with_tag`. Also, "retag" is a [term from Stacked Borrows](https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md#retagging) with a [corresponding Machine hook](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/interpret/machine/trait.Machine.html#method.retag), and this function has nothing to do with that other use of the term. r? @oli-obk
2019-09-17Rollup merge of #64541 - RalfJung:miri-errors, r=oli-obkTyler Mandry-1/+14
document Miri error categories r? @oli-obk
2019-09-17Get rid of special const intrinsic query in favour of `const_eval`Oliver Scherer-0/+9
2019-09-17rename Allocation::retag -> with_tags_and_extraRalf Jung-2/+2
2019-09-17document Miri error categoriesRalf Jung-1/+14
2019-09-14Rollup merge of #64116 - ZeGentzy:patch-1, r=oli-obkMazdak Farrokhzad-2/+2
Fix minor typo in docs. This comment is prolly refering to the comment in [const_eval_raw_provider](https://github.com/rust-lang/rust/pull/64116/files#diff-e0b58bb6712edaa8595ad7237542c958R616), not itself.
2019-09-13Update value.rsHal Gentz-2/+2
2019-09-07Apply suggestions from code reviewAlexander Regueiro-5/+5
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-09-07Aggregation of cosmetic changes made during work on REPL PRs: librustcAlexander Regueiro-128/+126
2019-09-06Rollup merge of #64202 - alexreg:rush-pr-1, r=CentrilMazdak Farrokhzad-6/+6
Fixed grammar/style in some error messages Factored out from hacking on rustc for work on the REPL. r? @Centril
2019-09-06Fix miriOliver Scherer-0/+28
2019-09-06Fixed grammar/style in error messages and reblessed tests.Alexander Regueiro-6/+6
2019-09-03Update other doc.Hal Gentz-2/+2
Value was renamed to Operand in https://github.com/rust-lang/rust/commit/ad2de8b4ee099916113b7b3577ac86857b1568be ScalarPair to Slice in https://github.com/rust-lang/rust/commit/fe50b4eb1d6f7a31c53798bca3d0fa2b0670fa3d Not familiar enough with rustc's source to know if the comment is even still applicable.
2019-09-02Auto merge of #63561 - HeroicKatora:alloc-private-bytes, r=oli-obkbors-13/+196
Make Allocation::bytes private Fixes #62931. Direct immutable access to the bytes is still possible but redirected through the new method `raw_bytes_with_undef_and_ptr`, similar to `get_bytes_with_undef_and_ptr` but without requiring an interpretation context and not doing *any* relocation or bounds checks. The `size` of the allocation is stored separately which makes access as `Size` and `usize` more ergonomic. cc: @RalfJung
2019-08-31Reorder AllocationDefinedness membersAndreas Molzer-2/+3
This improves the clarity of the documentation a bit since they can reference each other when reading the member docs in sequence.
2019-08-31Improve documentation around allocation accessorsAndreas Molzer-8/+13
2019-08-30Move relocation range copies into allocationAndreas Molzer-0/+50
2019-08-29Make allocation relocation field privateAndreas Molzer-4/+9
2019-08-28Address naming and comments from reviewsAndreas Molzer-4/+4
2019-08-21Expose encapsulated undef mask as immutableAndreas Molzer-0/+5
2019-08-21Replace usage of alloc.bytes in interpretAndreas Molzer-0/+2
There is now a dedicate `len` method which avoids the need to access the bytes. Access the length as `Size` can also be done by a direct member. The constructors guarantee that these representations are convertable. Access which relies on the bytes, such as snapshot, can use direct raw access by reference as it does not care about undef and relocations or properly checks them seperately.
2019-08-19Auto merge of #63670 - Dante-Broggi:patch-2, r=Centrilbors-1/+1
Size has a ::zero
2019-08-17size has a zeroDante-Broggi-1/+1
2019-08-17fix typosDante-Broggi-1/+1
2019-08-17Move copy of undef_mask into allocationAndreas Molzer-0/+85
This also means that the compressed representation chosen may be optimized together with any changes to the undef_mask.
2019-08-17Derive HashStable for AllocationAndreas Molzer-1/+12
Requires a manual implementation for Relocations since dereferencing to SortedMap is not always implemented but that one is far more trivial. Added fields could otherwise be silently forgotten since private fields make destructing outside the module possible only with `..` pattern which would then also be applicable to newly added public fields.
2019-08-17Store allocation size, make bytes, undef_mask privateAndreas Molzer-8/+27
Direct access to the bytes was previously a problem (#62931) where components would read their contents without properly checking relocations and/or definedness. Making bytes private instead of purely renaming them also helps in allowing amendments to their allocation scheme (such as eliding allocation for undef of constant regions).
2019-08-14Rollup merge of #63075 - RalfJung:deref-checks, r=oli-obkMazdak Farrokhzad-1/+4
Miri: Check that a ptr is aligned and inbounds already when evaluating `*` This syncs Miri with what the Nomicon and the Reference say, and resolves https://github.com/rust-lang/miri/issues/447. Also this would not have worked without https://github.com/rust-lang/rust/pull/62982 due to new cycles. ;) r? @oli-obk
2019-08-10rename RUST_CTFE_BACKTRACE to RUSTC_CTFE_BACKTRACERalf Jung-1/+1
2019-08-07Auto merge of #63152 - estebank:big-array, r=oli-obkbors-7/+11
Always error on `SizeOverflow` during mir evaluation Fix #55878, fix #25116. r? @oli-obk
2019-08-05Auto merge of #63079 - RalfJung:ctfe-no-align, r=oli-obkbors-10/+3
CTFE: simplify ConstValue by not checking for alignment I hope the test suite actually covers the problematic cases here? r? @oli-obk Fixes https://github.com/rust-lang/rust/issues/61952
2019-08-04tweak output and testsEsteban Küber-1/+3
2019-08-04AssumptionNotHeld is used only once in Miri and never caught... remove from enumRalf Jung-4/+0
2019-08-04move AssumptionNotHeld to UBRalf Jung-3/+4
2019-08-03avoid mutable state and override main messageEsteban Küber-5/+6
2019-08-03add variant for experimental UB (like Stacked Borrows)Ralf Jung-3/+5
2019-08-03also add macros for free-form error messagesRalf Jung-0/+10
2019-08-02dedup free-form Unsupported errors; add macros for free-form UB and ↵Ralf Jung-13/+12
Unsupported cases
2019-08-02be less BritishRalf Jung-8/+8
2019-08-02CTFE: simplify Value type by not checking for alignmentRalf Jung-10/+3
2019-08-02Nicer labels for type layout errorsEsteban Küber-2/+2
2019-08-02Do not lint on SizeOverflow, always errorEsteban Küber-1/+3
2019-08-02Always error on `SizeOverflow` during mir evaluationEsteban Küber-1/+0
2019-08-01code review fixesSaleem Jaffer-5/+1