about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
AgeCommit message (Collapse)AuthorLines
2018-10-09For now, accept all data for integer types when not in const modeRalf Jung-8/+10
We'll try ruling out undef later
2018-10-09tidy upRalf Jung-1/+1
2018-10-09do not look at refs to external statics at allRalf Jung-15/+22
2018-10-09miri engine: also check return type before calling functionRalf Jung-1/+20
2018-10-09add machine option to validate things on every copyRalf Jung-9/+37
2018-10-09also validate everything that has a Scalar layout, to catch NonNullRalf Jung-8/+86
2018-10-09fix validating arrays of ZSTsRalf Jung-5/+20
Fixes #54751
2018-10-09switch validation of scalars to be type-drivenRalf Jung-99/+63
This does not actually regress anything. It would regress NonNull, but we didn't handle that correctly previously either.
2018-10-09check that entire ref is in-bounds before recursing; add macro for ↵Ralf Jung-81/+50
validation msgs on error
2018-10-09miri validity: make recursive ref checking optionalRalf Jung-81/+118
2018-10-02Update a FIXME in memory.rsWesley Wiser-1/+1
In #51833, I improved the performance of `copy_undef_mask()`. As such, the old FIXME wasn't appropriate anymore. The main remaining thing left to do is to implement a fast path for non-overlapping copies (per @oli-obk).
2018-10-01Auto merge of #54693 - RalfJung:ctfe-scalar-pair-undef, r=oli-obkbors-13/+111
do not normalize all non-scalar constants to a ConstValue::ScalarPair We still need `ConstValue::ScalarPair` for match handling (matching slices and strings), but that will never see anything `Undef`. For non-fat-ptr `ScalarPair`, just point to the allocation like larger data structures do. Fixes https://github.com/rust-lang/rust/issues/54387 r? @eddyb
2018-09-30use is_uninhabited in more placesJorge Aparicio-1/+1
2018-09-30move ScalarMaybeUndef into the miri engineRalf Jung-12/+110
2018-09-30do not normalize non-scalar constants to a ConstValue::ScalarPairRalf Jung-1/+1
2018-09-29Merge branch 'master' into dropMichael Bradshaw-1/+1
2018-09-29Revert "Auto merge of #53508 - japaric:maybe-uninit, r=RalfJung"Ralf Jung-1/+1
This reverts commit c6e3d7fa3113aaa64602507f39d4627c427742ff, reversing changes made to 4591a245c7eec9f70d668982b1383cd2a6854af5.
2018-09-26Make core::mem::needs_drop a const fnMichael Bradshaw-0/+7
2018-09-23Auto merge of #54380 - RalfJung:miri-snapshot, r=eddybbors-274/+195
move CTFE engine snapshot state out of miri engine into CTFE machine instance It still lives in the `interpret` module as it needs access to all sorts of private stuff. Also rename a thing to make @eddyb happy :D The goal was not to change any behavior.
2018-09-22Auto merge of #53508 - japaric:maybe-uninit, r=RalfJungbors-1/+1
Implement `MaybeUninit` This PR: - Adds `MaybeUninit` (see #53491) to `{core,std}::mem`. - Makes `mem::{uninitialized,zeroed}` panic when they are used to instantiate an uninhabited type. - Does *not* deprecate `mem::{uninitialized,zeroed}` just yet. As per https://github.com/rust-lang/rust/issues/53491#issuecomment-414147666, we should not deprecate them until `MaybeUninit` is stabilized. - It replaces uses of `mem::{uninitialized,zeroed}` in core and alloc with `MaybeUninit`. There are still several instances of `mem::{uninitialized,zeroed}` in `std` that *this* PR doesn't address. r? @RalfJung cc @eddyb you may want to look at the new panicking logic
2018-09-22Auto merge of #54188 - lqd:fallout-53695, r=nikomatsakisbors-2/+2
NLL: disallow creation of immediately unusable variables Fix #53695 Original description follows ---- This WIP PR is for discussing the impact of fixing #53695 by injecting a fake read in let patterns. (Travis will fail, at least the `mir-opt` suite is failing in its current state)
2018-09-22use is_uninhabited in more placesJorge Aparicio-1/+1
2018-09-21fix commentRalf Jung-1/+1
2018-09-20unsurprisingly, miri needs tcxRalf Jung-1/+1
2018-09-20move loop detector constants to the module that uses them; make lifetime ↵Ralf Jung-13/+12
order in ConstPropagator consistent with Memory
2018-09-20make some things a bit more privateRalf Jung-3/+4
2018-09-20rename evaluator -> interpreter to make eddyb happyRalf Jung-19/+6
2018-09-20move CTFE engine snapshot state out of miri engine into CTFE machine instanceRalf Jung-254/+188
2018-09-18Refactor 'ReadForMatch' into 'FakeRead' and add the cause of the fake readRemy Rakic-2/+2
2018-09-17miri: correctly compute expected alignment for fieldRalf Jung-1/+4
2018-09-15keep around some information for dead allocations so that we can use it to ↵Ralf Jung-9/+50
make sure a dangling ptr aligned and non-NULL
2018-09-14Auto merge of #54032 - oli-obk:layout_scalar_ranges, r=eddybbors-4/+10
Add forever unstable attribute to allow specifying arbitrary scalar ranges r? @eddyb for the first commit and @nikomatsakis for the second one
2018-09-14Rollup merge of #54095 - kenta7777:kenta7777#53719, r=davidtwcokennytm-1/+1
Rename all mentions of `nil` to `unit` Fixes #53719. Renamed keywords nil to unit.
2018-09-14Rollup merge of #54076 - RalfJung:miri-snapshot, r=oli-obkkennytm-26/+37
miri loop detector hashing * fix enum hashing to also consider discriminant * do not hash extra machine state * standalone miri is not interested in loop detection, so let it opt-out In the future I think we want to move the hashing logic out of the miri engine, this is CTFE-only. r? @oli-obk
2018-09-12Merge branch 'master' into kenta7777#53719kenta7777-1/+1
2018-09-11Fix const eval of ZST index operations to make the static assertion workOliver Schneider-4/+10
2018-09-10add the `AscribeUserType` statement kindNiko Matsakis-1/+1
Make it have the semantics of subtype.
2018-09-10renamed mk_nil to mk_unitkenta7777-1/+1
2018-09-09miri loop detector hashing: fix enum hashing to also consider discriminant; ↵Ralf Jung-26/+37
do not hash extra machine state standalone miri is not interested in loop detection
2018-09-08Auto merge of #53903 - GabrielMajeri:opt-miri-array-slice, r=oli-obkbors-18/+61
Optimize miri checking of integer array/slices This pull request implements the optimization described in #53845 (the `E-easy` part of that issue, not the refactoring). Instead of checking every element of an integral array, we can check the whole memory range at once. r? @RalfJung
2018-09-08Optimize miri checking of integer array/slicesGabriel Majeri-18/+61
Instead of checking every element, we can check the whole memory range at once.
2018-09-07make field always private, add `From` implsNiko Matsakis-2/+1
2018-09-07Rollup merge of #53991 - TimDiekmann:fix-unchecked-intrinsics, r=oli-obkkennytm-4/+18
Add unchecked_shl/shr check for intrinsics to fix miri's test suit r? @RalfJung cc @oli-obk #53697 broke miri's test suite as described in [this comment](https://github.com/rust-lang/rust/pull/53697#issuecomment-419034668). This PR adds test for the `unchecked_shr/shl` for the intrinsics.
2018-09-06Auto merge of #52626 - brunocodutra:issue-52475, r=oli-obkbors-178/+504
Fix issue #52475: Make loop detector only consider reachable memory As [suggested](https://github.com/rust-lang/rust/pull/51702#discussion_r197585664) by @oli-obk `alloc_id`s should be ignored by traversing all `Allocation`s in interpreter memory at a given moment in time, beginning by `ByRef` locals in the stack. - [x] Generalize the implementation of `Hash` for `EvalSnapshot` to traverse `Allocation`s - [x] Generalize the implementation of `PartialEq` for `EvalSnapshot` to traverse `Allocation`s - [x] Commit regression tests Fixes #52626 Fixes https://github.com/rust-lang/rust/issues/52849
2018-09-06Use binary_op_val instead of doing the check manually.Tim-10/+9
2018-09-06Move check out of the match on the intrinsic nameTim-16/+7
2018-09-06Add unchecked_shl/shr checks for intrinsicsTim-4/+28
2018-09-03Auto merge of #53883 - RalfJung:miri-assert, r=oli-obkbors-0/+2
miri engine: make sure we do not copy unsized data r? @oli-obk
2018-09-03Document snapshot.rsBruno Dutra-0/+6
2018-09-03Move InfiniteLoopDetector to snapshot.rsBruno Dutra-73/+75