about summary refs log tree commit diff
path: root/src/librustc/mir/interpret
AgeCommit message (Collapse)AuthorLines
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-3001/+0
2020-03-28use machine_ prefix for target usize/isizeRalf Jung-2/+2
2020-03-28rename Scalar::{ptr_null -> null_ptr}Ralf Jung-1/+1
2020-03-26avoid catching InterpErrorRalf Jung-5/+11
2020-03-25add usize methods for Size gettersRalf Jung-4/+4
2020-03-25go back to infix ops for SizeRalf Jung-12/+12
2020-03-25add helper method for ptr ops on Scalar; reduce unnecessary large operand of ↵Ralf Jung-49/+35
overflowing_signed_offset
2020-03-25use Size addition instead of checked int additionRalf Jung-1/+1
2020-03-25make Size::from* methods generic in the integer type they acceptRalf Jung-11/+6
2020-03-25use checked casts and arithmetic in Miri engineRalf Jung-91/+107
2020-03-25Rollup merge of #70373 - Centril:canon-imports, r=Mark-SimulacrumMazdak Farrokhzad-1/+1
normalize some imports & prefer direct ones r? @Mark-Simulacrum
2020-03-24normalize some imports, prefer direct ones.Mazdak Farrokhzad-1/+1
2020-03-24move ModifiedStatic error to ConstEval errors, and generally adjust ↵Ralf Jung-9/+0
terminology from "static" to "global" where appropriate
2020-03-24Rollup merge of #70267 - RalfJung:const-prop-unsup, r=oli-obk,wesleywiserMazdak Farrokhzad-13/+31
get rid of ConstPropUnsupported; use ZST marker structs instead This gets rid of yet another machine-specific error variant. r? @oli-obk
2020-03-24Rollup merge of #70087 - ecstatic-morse:remove-const-eval-loop-detector, ↵Mazdak Farrokhzad-7/+7
r=RalfJung Remove const eval loop detector Now that there is a configurable instruction limit for CTFE (see #67260), we can replace the loop detector with something much simpler. See #66946 for more discussion about this. Although the instruction limit is nightly-only, the only practical way to reach the default limit uses nightly-only features as well (although CTFE will still execute code using such features inside an array initializer on stable). This will at the very least require a crater run, since it will result in an error wherever the "long running const eval" warning appeared before. We may need to increase the default for `const_eval_limit` to work around this. Resolves #54384 cc #49980 r? @oli-obk cc @RalfJung
2020-03-24Rollup merge of #69981 - oli-obk:const_blocks, r=eddybMazdak Farrokhzad-1/+1
Evaluate repeat expression lengths as late as possible Fixes #68567 r? @varkor
2020-03-23Remove leftover mentions of `from_anon_const`Oliver Scherer-1/+1
2020-03-23Rollup merge of #70318 - anyska:multiple-derives, r=Dylan-DPCMazdak Farrokhzad-61/+10
Split long derive lists into two derive attributes.
2020-03-23Rollup merge of #70299 - RalfJung:err_machine_stop, r=oli-obkMazdak Farrokhzad-3/+8
add err_machine_stop macro We have that for all other error kinds, but here I somehow forgot it. r? @oli-obk
2020-03-23Split long derive lists into two derive attributes.Ana-Maria Mihalache-61/+10
2020-03-23make sure we are checking the size of the right thingRalf Jung-1/+1
2020-03-23add macro to reduce boilerplate and keep readable messagesRalf Jung-1/+1
2020-03-23Rollup merge of #70286 - RalfJung:no-experiments, r=petrochenkovMazdak Farrokhzad-5/+2
Miri error type: remove UbExperimental variant In https://github.com/rust-lang/miri/pull/1250, I will move Miri away from that variant, and use a custom `MachineStop` exception instead.
2020-03-23add err_machine_stop macroRalf Jung-3/+8
2020-03-22remove UbExperimental variantRalf Jung-5/+2
2020-03-22avoid unsafe code, use upcasting-trait instead (trick by oli)Ralf Jung-25/+16
2020-03-22Rename `TimeLimitReached` -> `StepLimitReached`Dylan MacKenzie-2/+4
2020-03-22remove redundant closures (clippy::redundant_closure)Matthias Krüger-1/+1
2020-03-22get rid of ConstPropUnsupported; use ZST marker structs insteadRalf Jung-13/+40
2020-03-20more type annotations to help inferenceRalf Jung-5/+5
2020-03-19do not 'return' in 'throw_' macrosRalf Jung-5/+6
2020-03-18Rollup merge of #69839 - RalfJung:miri-error-cleanup, r=oli-obkMazdak Farrokhzad-217/+134
Miri error reform Some time ago we started moving Miri errors into a few distinct categories, but we never classified all the old errors. That's what this PR does. ~~This is on top of https://github.com/rust-lang/rust/pull/69762; [relative diff](https://github.com/RalfJung/rust/compare/validity-errors...RalfJung:miri-error-cleanup).~~ r? @oli-obk Fixes https://github.com/rust-lang/const-eval/issues/4
2020-03-17Use `const_eval_limit` instead of infinite loop detectorDylan MacKenzie-7/+5
2020-03-14add Scalar::from methods for signed integersRalf Jung-0/+26
2020-03-11fmtRalf Jung-1/+1
2020-03-11make error message less confusingRalf Jung-2/+2
2020-03-11generalize InvalidNullPointerUsage to InvalidIntPointerUsageRalf Jung-9/+5
2020-03-11fmt, tweak messages and blessRalf Jung-20/+25
2020-03-11miri: categorize errors into "unsupported" and "UB"Ralf Jung-213/+129
Also slightly refactor pointer bounds checks to avoid creating unnecessary temporary Errors
2020-03-10[Miri] Use a session variable instead of checking for an env var alwaysWesley Wiser-13/+20
In CTFE heavy code, checking the env var everytime is inefficient. We can do a lot better by using a `Session` variable instead.
2020-03-09Rollup merge of #69762 - RalfJung:validity-errors, r=oli-obkMazdak Farrokhzad-4/+23
Ensure that validity only raises validity errors For now, only as a debug-assertion (similar to const-prop detecting errors that allocate). Now includes https://github.com/rust-lang/rust/pull/69646. [Relative diff](https://github.com/RalfJung/rust/compare/layout-visitor...RalfJung:validity-errors). r? @oli-obk
2020-03-08use static strings instead of tcxRalf Jung-5/+5
2020-03-08Fix typoRalf Jung-2/+2
Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>
2020-03-08fix some cases of unexpected exceptions leaving validationRalf Jung-5/+8
2020-03-08move error allocation test to error.rsRalf Jung-1/+17
2020-03-08Rollup merge of #69326 - JOE1994:os_str_widestring, r=RalfJungMazdak Farrokhzad-0/+10
mir-interpret: add method to read wide strings from Memory Implemented *step2* from [instructions](https://github.com/rust-lang/miri/issues/707#issuecomment-561564057) laid out in rust-lang/miri#707. Added 2 new methods to struct `rustc_mir::interpret::InterpCx`. * `read_os_str_from_wide_str` (src/librustc_mir/interpret/operand.rs) * `write_os_str_to_wide_str` (src/librustc_mir/interpret/place.rs) - used existing logic implemented in [MIRI/src/eval.rs](https://github.com/rust-lang/miri/blob/94732aaf7bf79fd01a4a48d11155c6586b937514/src/eval.rs#L132-L141) These methods are intended to be used for environment variable emulation in Windows.
2020-03-06mir-interpret: add method Memory::read wide_stringJOE1994-0/+10
2020-03-06fix various typosMatthias Krüger-1/+1
2020-03-04use integer assoc consts instead of methodsRalf Jung-9/+9
2020-03-04Auto merge of #69550 - RalfJung:scalar, r=oli-obkbors-28/+14
interpret engine: Scalar cleanup * Remove `to_ptr` * Make `to_bits` private r? @oli-obk