about summary refs log tree commit diff
path: root/src/librustc_mir/interpret/eval_context.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-1039/+0
2020-08-12fix typosRalf Jung-2/+2
Co-authored-by: Oliver Scherer <github35764891676564198441@oli-obk.de>
2020-08-12more precise span for erroneous consts during CTFE/MiriRalf Jung-13/+26
2020-08-12miri: fall back to whole-function span when loc==NoneRalf Jung-9/+8
2020-08-12only set frame location during push after preamble is doneRalf Jung-1/+2
2020-08-11Rollup merge of #75338 - RalfJung:const-eval-stack-size-check, r=oli-obkYuki Okushi-5/+1
move stack size check to const_eval machine This is consistent with how we enforce the step limit. In particular, we do not want this limit checked for Miri-the-tool.
2020-08-09evaluate required_consts when pushing stack frame in Miri engineRalf Jung-0/+7
2020-08-09move stack size check to const_eval machineRalf Jung-5/+1
2020-08-09move const_eval error reporting logic into rustc_mir::const_eval::errorRalf Jung-4/+31
2020-08-01Auto merge of #74726 - oli-obk:tracing, r=Mark-Simulacrumbors-2/+1
Move from `log` to `tracing` The only visible change is that we now get timestamps in our logs: ``` Jul 24 18:41:01.065 TRACE rustc_mir::transform::const_prop: skipping replace of Rvalue::Use(const () because it is already a const Jul 24 18:41:01.065 TRACE rustc_mir::transform::const_prop: propagated into _2 Jul 24 18:41:01.065 TRACE rustc_mir::transform::const_prop: visit_constant: const () ``` This PR was explicitly designed to be as low-impact as possible. We can now move to using the name `tracing` insteads of `log` on a crate-by-crate basis and use any of the other tracing features where desirable. As far as I can tell this will allow tools to seamlessly keep working (since they are using `rustc_driver::init_log...`). This is the first half of step 1 of the accepted `tracing` MCP (https://github.com/rust-lang/compiler-team/issues/331)
2020-07-31Move from `log` to `tracing`Oliver Scherer-2/+1
2020-07-31Miri: fix ICE when unwinding past topmost stack frameRalf Jung-0/+4
2020-07-28Replace all uses of `log::log_enabled` with `Debug` printersOliver Scherer-48/+58
2020-07-27rename eval_const_to_op -> const_to_opRalf Jung-3/+3
2020-07-26Miri: replace canonical_alloc_id mechanism by extern_static_alloc_id which ↵Ralf Jung-6/+9
is called only when a pointer is 'imported' into the machine
2020-07-17Rename TypeckTables to TypeckResults.Valentin Lazureanu-4/+2
2020-07-15update promoted_mirBastian Kauschke-5/+1
2020-07-15update const arg queriesBastian Kauschke-3/+3
2020-07-15const generics work!Bastian Kauschke-1/+5
2020-07-15continue mir pipelineBastian Kauschke-1/+5
2020-07-15InstanceDef::ItemBastian Kauschke-9/+11
2020-06-28Rollup merge of #73757 - oli-obk:const_prop_hardening, r=wesleywiserManish Goregaokar-0/+7
Const prop: erase all block-only locals at the end of every block I messed up this erasure in https://github.com/rust-lang/rust/pull/73656#discussion_r446040140. I think it is too fragile to have the previous scheme. Let's benchmark the new scheme and see what happens. r? @wesleywiser cc @felix91gr
2020-06-28Erase all block-only locals at the end of every block, even if they have not ↵Oliver Scherer-0/+7
been touched.
2020-06-27Rollup merge of #72796 - RalfJung:mir-assign-sanity, r=matthewjasperManish Goregaokar-36/+23
MIR sanity check: validate types on assignment This expands the MIR validation added by @jonas-schievink in https://github.com/rust-lang/rust/pull/72093 to also check that on an assignment, the types of both sides match. Cc @eddyb @oli-obk
2020-06-24reduce sanity check in debug modeRalf Jung-2/+8
2020-06-23Rollup merge of #73578 - RalfJung:ty-ctxt-at, r=jonas-schievinkDylan DPC-1/+1
Make is_freeze and is_copy_modulo_regions take TyCtxtAt Make is_freeze and is_copy_modulo_regions take TyCtxtAt instead of separately taking TyCtxt and Span. This is consistent with is_sized.
2020-06-22make layout check a mere sanity checkRalf Jung-18/+7
2020-06-22expand a commentRalf Jung-1/+3
2020-06-22also use relator in interpreter assignment sanity checkRalf Jung-26/+15
2020-06-22also normalize constants when comparing typesRalf Jung-0/+1
2020-06-21Miri: replace many bug! by span_bug!Ralf Jung-2/+5
2020-06-21Make is_freeze and is_copy_modulo_regions take TyCtxtAtRalf Jung-1/+1
2020-06-15Rollup merge of #72879 - RalfJung:miri-tctx-at, r=oli-obkRalf Jung-9/+15
Miri: avoid tracking current location three times Miri tracks the current instruction to execute in the call stack, but it also additionally has two `TyCtxtAt` that carry a `Span` that also tracks the current instruction. That is quite silly, so this PR uses `TyCtxt` instead, and then uses a method for computing the current span when a `TyCtxtAt` is needed. Having less redundant (semi-)global state seems like a good improvement to me. :D To keep the ConstProp errors the same, I had to add the option to `error_to_const_error` to overwrite the span. Also for some reason this changes cycle errors a bit -- not sure if we are now better or worse as giving those queries the right span. (It is unfortunately quite easy to accidentally use `DUMMY_SP` by calling the query on a `TyCtxt` instead of a `TyCtxtAt`.) r? @oli-obk @eddyb
2020-06-14keep root_span and tcx togetherRalf Jung-29/+18
2020-06-13run const_eval_raw with root_spanRalf Jung-1/+1
2020-06-13avoid computing precise span for const_eval queryRalf Jung-1/+1
2020-06-12fix caller_location intrinsic for MiriRalf Jung-9/+2
2020-06-12avoid computing cur_span all the timeRalf Jung-3/+5
2020-06-12fix const_prop spans and re-bless testsRalf Jung-3/+3
2020-06-12make miri InterpCx TyCtxtAt a TyCtxt, and separately remember the root span ↵Ralf Jung-22/+38
of the evaluation
2020-06-12make miri memory TyCtxtAt a TyCtxtRalf Jung-2/+1
2020-05-28standardize limit comparisons with `Limit` typeDavid Wood-1/+1
This commit introduces a `Limit` type which is used to ensure that all comparisons against limits within the compiler are consistent (which can result in ICEs if they aren't). Signed-off-by: David Wood <david@davidtw.co>
2020-05-22Use `OnceCell` instead of `Once`Dylan MacKenzie-1/+1
2020-05-10Miri interning: replace ICEs by proper errors, make intern_shallow type ↵Ralf Jung-0/+3
signature more precise
2020-05-07Renamed "undef" stuff to "uninit"Hanif Bin Ariffin-4/+4
1. InvalidUndefBytes -> InvalidUninitBytes 2. ScalarMaybeUndef -> ScalarMaybeUninit 3. UndefMask -> InitMask Related issue #71193
2020-05-01remove AllocId generalization of PointerRalf Jung-5/+5
2020-04-27Use `LocalDefId` in `typeck_tables_of` and `used_trait_imports` queriesmarmeladema-3/+5
2020-04-24Remove `Option` from the return type of `def_kind`.Eduard-Mihai Burtescu-1/+1
2020-04-24Rollup merge of #71475 - RalfJung:miri-frame-loc, r=ecstatic-morseDylan DPC-30/+20
Miri Frame: use mir::Location to represent position in function I only recently learned that `Location` exists, and it seems to perfectly fit what Miri needs to represent which statement we are currently executing. :) r? @ecstatic-morse
2020-04-23Miri Frame: use mir::Location to represent position in functionRalf Jung-30/+20