about summary refs log tree commit diff
path: root/src/librustc/mir/interpret
AgeCommit message (Collapse)AuthorLines
2018-11-08Move `Pointer` to its own moduleOliver Scherer-147/+155
2018-11-08Move ScalarMaybeUndef into `value.rs`Oliver Scherer-129/+129
2018-11-08Move UndefMask and Relocations into `allocation.rs`Oliver Scherer-138/+138
2018-11-08Move the `memory_accessed` hook onto the `Extra` valueOliver Scherer-1/+31
2018-11-08Move `ScalarMaybeUndef` back to rustcOliver Scherer-0/+128
2018-11-08Move `Allocation` into its own moduleOliver Scherer-740/+9
2018-11-08Duplicate mod.rs for better diff trackingOliver Scherer-0/+752
2018-11-05add method to obtain the ptr offset of a ScalarRalf Jung-0/+13
2018-11-05proide ptr_wrapping_offset on ScalarsRalf Jung-43/+65
2018-11-05fix validation error on non-integer enum discriminantsRalf Jung-3/+12
2018-11-04rustc_target: pass contexts by reference, not value.Eduard-Mihai Burtescu-32/+32
2018-10-30Use vec![x; n] instead of iter::repeat(x).take(n).collect()ljedrz-4/+2
2018-10-28always print backtrace when CTFE_BACKTRACE is setRalf Jung-2/+2
No point in making the user also enable RUST_LOG
2018-10-28remove some unused CTFE error variantsRalf Jung-50/+1
2018-10-28rename env var to control ctfe backtraces, and make it usually show the ↵Ralf Jung-36/+66
backtrace delayed The env var is now RUST_CTFE_BACKTRACE. Similar to RUST_BACKTRACE, it usually only prints a backtrace when the error actually surfaces, not when it happens. This makes a difference when we catch errors. As per @oli-obk's request, one can set RUST_CTFE_BACKTRACE=immediate to get the backtrace shown immediately.
2018-10-26Auto merge of #53821 - oli-obk:sanity_query, r=RalfJungbors-30/+50
Report const eval error inside the query Functional changes: We no longer warn about bad constants embedded in unused types. This relied on being able to report just a warning, not a hard error on that case, which we cannot do any more now that error reporting is consistently centralized. r? @RalfJung fixes #53561
2018-10-25preserve const eval error information through trait error systemRalf Jung-1/+1
2018-10-25for now, just use NULL ptr for unsized localsRalf Jung-5/+5
2018-10-25Layout errors can happen because something was too genericOliver Schneider-3/+4
2018-10-25Report const eval error inside the queryOliver Schneider-24/+43
2018-10-25Rollup merge of #55345 - RalfJung:no-null, r=oli-obkPietro Albini-9/+1
Remove is_null It was confusingly named (`is_zero` would have been better, as someone pointed out somewhere but I forgot who or where), and it didn't even reliably test for "is this value 0 at run-time" because out-of-bounds pointers *can* be 0. It's not used in rustc, and miri only really needs `is_null_ptr` and `to_bytes() == 0`, so let's just kill this method. r? @oli-obk
2018-10-25Remove is_nullRalf Jung-9/+1
It was confusingly named (`is_zero` would have been better), and it didn't even reliably test for "is this value 0 at run-time" because out-of-bounds pointers *can* be 0.
2018-10-23fix typos in various placesMatthias Krüger-1/+1
2018-10-21Auto merge of #55125 - RalfJung:stacked-borrows, r=oli-obkbors-2/+6
miri engine: Hooks for basic stacked borrows r? @oli-obk
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-2/+2
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-2/+2
2018-10-18add support for storing extra data in an allocationRalf Jung-2/+6
2018-10-10typos and spacesRalf Jung-2/+2
2018-10-10miri engine: basic support for pointer provenance trackingRalf Jung-42/+90
2018-10-09miri engine: also check return type before calling functionRalf Jung-1/+7
2018-10-03A handful of cleanups for rustc/mirljedrz-2/+2
2018-10-01Auto merge of #54693 - RalfJung:ctfe-scalar-pair-undef, r=oli-obkbors-100/+10
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-30move ScalarMaybeUndef into the miri engineRalf Jung-94/+1
2018-09-30do not normalize non-scalar constants to a ConstValue::ScalarPairRalf Jung-6/+9
2018-09-29don't elide lifetimes in paths in librustc/Zack M. Davis-4/+4
This seemed like a good way to kick the tires on the elided-lifetimes-in-paths lint (#52069)—seems to work! This was also pretty tedious—it sure would be nice if `cargo fix` worked on this codebase (#53896)!
2018-09-08Auto merge of #53903 - GabrielMajeri:opt-miri-array-slice, r=oli-obkbors-10/+17
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-10/+17
Instead of checking every element, we can check the whole memory range at once.
2018-09-03Document snapshot.rsBruno Dutra-0/+5
2018-09-03Make vaious allocation related types generic on the allocation idBruno Dutra-10/+10
2018-08-29audit the relocations code, and clean it up a littleRalf Jung-1/+3
2018-08-29re-do argument passing one more time to finally be saneRalf Jung-7/+17
2018-08-29move some Scalar helpers from miri here, and use them where appropriateRalf Jung-2/+102
2018-08-28address nitsRalf Jung-3/+5
2018-08-27validate enum discriminant whenever it is readRalf Jung-1/+1
2018-08-27dedicated handling for binops on bool and char (UB if they are not valid)Ralf Jung-6/+19
2018-08-27Miri Memory WorkRalf Jung-10/+90
* 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.
2018-08-23Fix stylistic mistakesBernardo Meurer-2/+2
2018-08-23Reflow and fixup commentsBernardo Meurer-1/+2
2018-08-23Fixed long stringsBernardo Meurer-7/+12
2018-08-23Add license header to CTFE/MIRIBernardo Meurer-0/+30