about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
AgeCommit message (Collapse)AuthorLines
2019-09-25Tidygnzlbg-1/+2
2019-09-25Remove unreachable codegnzlbg-5/+0
2019-09-24Move tests to SIMD subdirectorygnzlbg-2/+2
2019-09-24Add const-eval support for SIMD types, insert, and extractgnzlbg-2/+71
2019-09-19Rollup merge of #63448 - RalfJung:miri-discriminant, r=eddybMazdak Farrokhzad-27/+60
fix Miri discriminant handling This can be reviewed commit-by-commit fairly well. The Miri side is at https://github.com/rust-lang/miri/pull/903. Fixes https://github.com/rust-lang/rust/issues/62138 r? @eddyb @oli-obk
2019-09-19first determine if the variant is a niche-variant, then compute absolute variantRalf Jung-15/+17
2019-09-17Get rid of special const intrinsic query in favour of `const_eval`Oliver Scherer-65/+69
2019-09-16do the variant idx computations on the host (non-overflowing)Ralf Jung-17/+13
2019-09-16factor getting the discriminant layout to a new methodRalf Jung-17/+4
2019-09-16better and more consistent variable namesRalf Jung-12/+12
2019-09-16fix Miri discriminant load/store when overflows are involvedRalf Jung-17/+65
2019-09-15update intern classification commentRalf Jung-1/+2
2019-09-15explain ty == NoneRalf Jung-0/+3
2019-09-15assert that nobody asks for mutable constantsRalf Jung-0/+4
2019-09-15note a FIXMERalf Jung-0/+2
2019-09-15relocations -> allocationsRalf Jung-13/+18
2019-09-15drop redundant ParamEnv, and avoid constructing InternVisitor without visitingRalf Jung-77/+93
2019-09-15all memory behind a constant must be immutableRalf Jung-1/+6
2019-09-15const interning: move mutability computation into intern_shallow, and always ↵Ralf Jung-66/+59
intern constants as immutable
2019-09-14Use try_fold instead of manually carrying an accumulatorSantiago Pastorino-4/+5
2019-09-11Make Place Boxed on Statement to reduce size from 64 bytes to 32 bytesSantiago Pastorino-1/+1
2019-09-09Convert Place's projection to a boxed sliceSantiago Pastorino-59/+55
2019-09-05Rollup merge of #64100 - wesleywiser:fix_miri_const_eval, r=oli-obkMazdak Farrokhzad-2/+3
Fix const eval bug breaking run-pass tests in Miri PR #63580 broke miri's ability to run the run-pass test suite with MIR optimizations enabled. The issue was that we weren't properly handling the substs and DefId associated with a Promoted value. This didn't break anything in rustc because in rustc this code runs before the Inliner pass which is where the DefId and substs can diverge from their initial values. It broke Miri though because it ran this code again after running the optimization pass. r? @oli-obk cc @RalfJung
2019-09-02Auto merge of #63561 - HeroicKatora:alloc-private-bytes, r=oli-obkbors-100/+46
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-09-02Fix const eval bug breaking run-pass tests in MiriWesley Wiser-2/+3
PR #63580 broke miri's ability to run the run-pass test suite with MIR optimizations enabled. The issue was that we weren't properly handling the substs and DefId associated with a Promoted value. This didn't break anything in rustc because in rustc this code runs before the Inliner pass which is where the DefId and substs can diverge from their initial values. It broke Miri though because it ran this code again after running the optimization pass.
2019-08-30mod-level doc comment for validity checkRalf Jung-0/+6
2019-08-30miri: detect too large dynamically sized objectsRalf Jung-13/+21
2019-08-30Fixup remaining direct relocation field referencesAndreas Molzer-1/+2
2019-08-30Move relocation range copies into allocationAndreas Molzer-27/+3
2019-08-29Make allocation relocation field privateAndreas Molzer-4/+4
2019-08-29Rollup merge of #63880 - RalfJung:miri-meta, r=oli-obkMazdak Farrokhzad-35/+54
Validation: check raw wide pointer metadata While I was at it, I also added a missing check for slices not to be too big. r? @oli-obk Fixes https://github.com/rust-lang/miri/issues/918
2019-08-28Address naming and comments from reviewsAndreas Molzer-2/+2
2019-08-26raw slices do not have to comply to the size limitRalf Jung-14/+5
2019-08-26Auto merge of #63580 - wesleywiser:move_promoted_out, r=oli-obkbors-4/+8
Move promoted MIR out of `mir::Body` r? @oli-obk
2019-08-25test for too long slicesRalf Jung-2/+14
2019-08-25validate raw wide pointersRalf Jung-2/+9
2019-08-25factor wide ptr metadata checking into separate methodRalf Jung-33/+42
also fat -> wide
2019-08-24Ensure miri can do bit ops on pointer valuesOliver Scherer-12/+16
2019-08-22Move def_id out add substsrefWesley Wiser-3/+3
2019-08-22Remove eval_promoted const-prop hackWesley Wiser-1/+5
2019-08-21Expose encapsulated undef mask as immutableAndreas Molzer-1/+1
2019-08-21Replace usage of alloc.bytes in interpretAndreas Molzer-14/+35
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-19rustc_mir: disallow non-monomorphic reifications.Eduard-Mihai Burtescu-1/+11
2019-08-19rustc_mir: disallow non-monomorphic vtables.Eduard-Mihai Burtescu-1/+6
2019-08-19rustc_mir: add missing subst_from_frame_and_normalize_erasing_regions calls.Eduard-Mihai Burtescu-1/+4
2019-08-19rustc_mir: use self.resolve instead of Instance::resolve where possible.Eduard-Mihai Burtescu-6/+1
2019-08-19rustc_mir: make subst_from_frame_and_normalize_erasing_regions infallible.Eduard-Mihai Burtescu-17/+10
2019-08-19rustc_mir: remove wrong calls to subst_from_frame_and_normalize_erasing_regions.Eduard-Mihai Burtescu-2/+0
2019-08-19start cleaning up subst messRalf Jung-58/+38
fix an ICE fix method name
2019-08-17Auto merge of #63671 - Centril:rollup-zufavt5, r=Centrilbors-1/+1
Rollup of 5 pull requests Successful merges: - #62451 (Add APIs for uninitialized Box, Rc, and Arc. (Plus get_mut_unchecked)) - #63487 (Remove meaningless comments in src/test) - #63657 (Crank up invalid value lint) - #63667 (resolve: Properly integrate derives and `macro_rules` scopes) - #63669 (fix typos in mir/interpret) Failed merges: r? @ghost