about summary refs log tree commit diff
path: root/src/librustc_mir/const_eval.rs
AgeCommit message (Collapse)AuthorLines
2018-11-07calling the ptr hooks no longer needs expensive preparation, remove the opt-outRalf Jung-1/+0
2018-11-05make ValueVisitor mut-polymorphicRalf Jung-1/+1
2018-11-05generalize the traversal part of validation to a ValueVisitorRalf Jung-3/+3
2018-11-02Rename `Value` to `Immediate` for miriOliver Scherer-4/+4
2018-10-29Assert that promoteds don't fail to be evaluated for being too genericOliver Scherer-1/+5
2018-10-29Auto merge of #55270 - RalfJung:stacked-borrows-ng, r=oli-obkbors-20/+9
miri engine: Stacked Borrows NG For more refined tracking in miri, we do return untagged pointers from the memory abstraction after allocations and let the caller decide how to tag these. Also refactor the `tag_(de)reference` hooks so they can be more easily called in the ref-to-place and place-to-ref methods, and reorder things in validation: validation calls ref-to-place which (when running in miri) triggers some checks, so we want to run it rather late and catch other problems first. We also do not need to redundantly check the ref to be allocated any more, the checks miri does anyway imply thath. r? @oli-obk
2018-10-28Auto merge of #54487 - RalfJung:ctfe-backtrace, r=oli-obkbors-7/+13
Delayed CTFE backtraces This renames the env var that controls CTFE backtraces from `MIRI_BACKTRACE` to `RUST_CTFE_BACKTRACE` so that we can use `MIRI_BACKTRACE` in the miri tool to only show backtraces of the main miri execution. It also makes `RUST_CTFE_BACKTRACE` only show backtraces that actually get rendered as errors, instead of showing them eagerly when the `Err` happens. The current behavior is near useless in miri because it shows about one gazillion backtraces for errors that we later catch and do not care about. However, @oli-obk likes the current behavior for rustc CTFE work so it is still available via `RUST_CTFE_BACKTRACE=immediate`. NOTE: This is based on top of https://github.com/rust-lang/rust/pull/53821. Only [the last three commits](https://github.com/oli-obk/rust/compare/sanity_query...RalfJung:ctfe-backtrace) are new. Fixes https://github.com/rust-lang/rust/issues/53355
2018-10-28don't tag new memory inside memory.rs; add machine hook to tag new memoryRalf Jung-2/+11
2018-10-28rename env var to control ctfe backtraces, and make it usually show the ↵Ralf Jung-7/+13
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-28validity in non-const mode relies on ref_to_mplace checking bounds; ↵Ralf Jung-25/+3
(de)reference hooks work on places
2018-10-28make (de)reference hooks more consistentRalf Jung-2/+4
2018-10-26Impl items have genericsOliver Scherer-0/+7
2018-10-26Auto merge of #53821 - oli-obk:sanity_query, r=RalfJungbors-45/+141
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-25Explain how unused constants may still cause a hard errorOliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer-0/+4
2018-10-25Rebase falloutOliver Schneider-8/+5
2018-10-25Addressed minor issues brought up in review.Alexander Regueiro-6/+9
2018-10-25Document error/lint cases in const evalOliver Schneider-1/+9
2018-10-25Explain the `Reveal::UserFacing` deduplication trickOliver Schneider-0/+7
2018-10-25Deduplicate all the ~~things~~ errorsOliver Schneider-0/+21
2018-10-25Report const eval error inside the queryOliver Schneider-44/+100
2018-10-23fix typos in various placesMatthias Krüger-1/+1
2018-10-18don't do any work towards ptr provenance in const modeRalf Jung-0/+1
2018-10-18add 'raw reference' to the machine hook, and use that in ptr-to-raw castsRalf Jung-1/+1
2018-10-18also hook dereferencingRalf Jung-9/+17
2018-10-18provide machine hooks for creating references and accessing memoryRalf Jung-1/+10
2018-10-18give machine more control over what counts as memory leakRalf Jung-0/+8
2018-10-18add support for storing extra data in an allocationRalf Jung-5/+5
2018-10-13make ENFORCE_VALIDITY a functionRalf Jung-1/+5
miri needs this extra flexibility
2018-10-13validate return value on stack popRalf Jung-4/+5
2018-10-10abstract mono_hash_map through a trait, only miri actually needs the fancy oneRalf Jung-2/+68
2018-10-10fix typosRalf Jung-1/+1
2018-10-10rename extra -> meta in placeRalf Jung-2/+2
2018-10-10miri engine: basic support for pointer provenance trackingRalf Jung-2/+12
2018-10-09add machine option to validate things on every copyRalf Jung-0/+1
2018-10-03Only promote calls to `#[rustc_promotable]` const fnsOliver Schneider-6/+0
2018-09-30do not normalize non-scalar constants to a ConstValue::ScalarPairRalf Jung-3/+13
2018-09-20fix stage 0 compilationRalf Jung-1/+2
2018-09-20move loop detector constants to the module that uses them; make lifetime ↵Ralf Jung-10/+10
order in ConstPropagator consistent with Memory
2018-09-20make some things a bit more privateRalf Jung-1/+1
2018-09-20rename evaluator -> interpreter to make eddyb happyRalf Jung-8/+8
2018-09-20move CTFE engine snapshot state out of miri engine into CTFE machine instanceRalf Jung-26/+76
2018-09-09miri loop detector hashing: fix enum hashing to also consider discriminant; ↵Ralf Jung-0/+1
do not hash extra machine state standalone miri is not interested in loop detection
2018-09-07make field always private, add `From` implsNiko Matsakis-1/+1
2018-09-03Implement Hash in terms of HashStable for EvalSnapshotBruno Dutra-0/+2
2018-08-29make ptr_op finally reponsible for all ops involving pointers; make ValTy ↵Ralf Jung-11/+7
constructor private Also remove public OpTy constructors, but a pub(crate) constructor remains
2018-08-28first test const-ness, then hook fn callRalf Jung-4/+6
2018-08-27use associated const for machine controlling mutable staticsRalf Jung-22/+4
So get rid of the IsStatic trait again
2018-08-27fix handling of unsized types in validation; validate str to be UTF-8Ralf Jung-2/+2
2018-08-27validate enum discriminant whenever it is readRalf Jung-1/+1
2018-08-27get rid of FinishStatic hack from stack clenaup; const_eval can do that itselfRalf Jung-9/+11