about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
AgeCommit message (Collapse)AuthorLines
2020-03-26Rollup merge of #70397 - JOE1994:write_wide_str, r=RalfJungDylan DPC-2/+42
add 'fn write_u16s' to Memory Added new function `Memory::write_u16s`. Needed in `MIRI` for implementing helper function to write wide_str to memory (for Windows).
2020-03-26Miri float->int casts: be explicit that this is saturatingRalf Jung-0/+4
2020-03-26Rename asm! to llvm_asm!Amanieu d'Antras-1/+1
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
2020-03-26add 'fn write_u16s'(rustc_mir::interpret::Memory)JOE1994-2/+42
2020-03-26Enable `--bless`ing of MIR dumpsOliver Scherer-71/+25
2020-03-26Rollup merge of #70385 - RalfJung:miri-nits, r=eddybMazdak Farrokhzad-1/+1
Miri nits: comment and var name improvement r? @eddyb
2020-03-25Rollup merge of #69700 - anyska:layout-details-rename, r=oli-obkDylan DPC-3/+3
Rename LayoutDetails to just Layout.
2020-03-25Rollup merge of #70379 - JOE1994:patch-2, r=petrochenkovDylan DPC-2/+2
fix incorrect type name in doc comments Change : `InterpCtx` => `InterpCx` (`rustc_mir::interpret::InterpCx`)
2020-03-25Rename LayoutDetails to just Layout.Ana-Maria Mihalache-3/+3
2020-03-25add usize methods for Size gettersRalf Jung-7/+6
2020-03-25go back to infix ops for SizeRalf Jung-21/+18
2020-03-25make Size::from* methods generic in the integer type they acceptRalf Jung-4/+4
2020-03-25remove unnecessary castRalf Jung-1/+1
2020-03-25miri: avoid a bunch of casts by offering usized-based field indexingRalf Jung-63/+97
2020-03-25avoid double-cast in mplace_fieldRalf Jung-8/+8
2020-03-25make bit_width return u64, consistently with other sizes in the compilerRalf Jung-7/+6
2020-03-25use checked casts and arithmetic in Miri engineRalf Jung-62/+79
2020-03-25miri: simplify shift operator overflow checkingRalf Jung-12/+13
2020-03-25rename def_id -> static_def_idRalf Jung-1/+1
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-24fix type name typo in doc commentsYoungsuk Kim-2/+2
InterpCtx => InterpCx (rustc_mir::interpret::InterpCx)
2020-03-24normalize some imports, prefer direct ones.Mazdak Farrokhzad-1/+1
2020-03-24fix const_prop ICERalf Jung-1/+5
2020-03-24get back the more precise error messageRalf Jung-1/+2
2020-03-24move ModifiedStatic error to ConstEval errors, and generally adjust ↵Ralf Jung-82/+87
terminology from "static" to "global" where appropriate
2020-03-24Rollup merge of #70087 - ecstatic-morse:remove-const-eval-loop-detector, ↵Mazdak Farrokhzad-440/+0
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-22miri engine: turn error sanity checks into assertionsRalf Jung-4/+3
2020-03-22Rollup merge of #70229 - matthiaskrgr:cl3ppy, r=Mark-SimulacrumDylan DPC-3/+5
more clippy fixes * remove unused unit values (clippy::unused_unit) * make some let-if-bindings more idiomatic (clippy::useless_let_if_seq) * clarify when we pass () to functions (clippy::unit_arg) * don't redundantly repeat field names (clippy::redundant_field_names) * remove redundant returns (clippy::needless_return) * use let instead of match for matches with single bindings (clippy::match_single_binding) * don't convert results to options just for matching (clippy::if_let_some_result)
2020-03-21Rollup merge of #70126 - wesleywiser:fix_miri_ice_neg_zst_enum_discr, ↵Dylan DPC-3/+7
r=RalfJung,eddyb Fix ICE caused by truncating a negative ZST enum discriminant Fixes #70114 r? @oli-obk or @RalfJung
2020-03-21clarify when we pass () to functions (clippy::unit_arg)Matthias Krüger-3/+5
2020-03-21Rename `cast_from_int` to `cast_from_int_like`Wesley Wiser-3/+5
2020-03-21Fix ICE caused by truncating a negative ZST enum discriminantWesley Wiser-1/+3
2020-03-21Rollup merge of #70138 - RalfJung:throw-not-return, r=oli-obkMazdak Farrokhzad-1/+1
do not 'return' in 'throw_' macros In https://github.com/rust-lang/rust/pull/69839 we turned a closure into a `try` block, but it turns out that does not work with our `throw_` macros, which `return` so they skip the `try`. Here we fix that. For some reason that means we also have to remove some `;`. r? @oli-obk
2020-03-21Rollup merge of #70189 - RalfJung:is_signed, r=eddybMazdak Farrokhzad-1/+1
Abi::is_signed: assert that we are a Scalar A bit more sanity checking, suggested by @eddyb. This makes this method actually "safer" than `TyS::is_signed`, so I made sure Miri consistently uses the `Abi` version. Though I am not sure if this would have caught the mistake where the layout of a zero-sized enum was asked for its sign. r? @eddyb
2020-03-21Rollup merge of #70187 - matthiaskrgr:cl2ppy, r=Mark-SimulacrumMazdak Farrokhzad-7/+5
more clippy fixes * remove redundant returns (clippy::needless_return) * remove redundant import (clippy::single_component_path_imports) * remove redundant format!() call (clippy::useless_format) * don't use ok() before calling expect() (clippy::ok_expect)
2020-03-21Rollup merge of #70165 - matthewjasper:erase-more, r=nikomatsakisMazdak Farrokhzad-1/+1
Remove the erase regions MIR transform We now ensure that MIR never contains unerased regions in the first place.
2020-03-21Rollup merge of #70139 - RalfJung:delay, r=eddybMazdak Farrokhzad-0/+4
add delay_span_bug to TransmuteSizeDiff, just to be sure See https://github.com/rust-lang/rust/pull/69839#discussion_r394858464. r? @eddyb
2020-03-20remove redundant returns (clippy::needless_return)Matthias Krüger-7/+5
2020-03-20Abi::is_signed: assert that we are a ScalarRalf Jung-1/+1
2020-03-20Rollup merge of #69935 - davidtwco:issue-69925, r=eddybYuki Okushi-15/+25
codegen/mir: support polymorphic `InstanceDef`s cc #69925 This PR modifies the use of `subst_and_normalize_erasing_regions` on parts of the MIR bodies returned from `instance_mir`, so that `InstanceDef::CloneShim` and `InstanceDef::DropGlue` (where there is a type) do not perform substitutions. This avoids double substitutions and enables polymorphic `InstanceDef`s. r? @eddyb cc @nikomatsakis
2020-03-20Rollup merge of #69768 - oli-obk:union_field_ice, r=eddyb,RalfJungYuki Okushi-9/+1
Compute the correct layout for variants of uninhabited enums r? @eddyb cc @RalfJung fixes #69191 cc #69763
2020-03-19Use erased regions in MIRMatthew Jasper-1/+1
2020-03-19add delay_span_bug to TransmuteSizeDiff, just to be sureRalf Jung-0/+4
2020-03-19do not 'return' in 'throw_' macrosRalf Jung-1/+1
2020-03-18Rollup merge of #69839 - RalfJung:miri-error-cleanup, r=oli-obkMazdak Farrokhzad-171/+203
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-17Remove infinite loop detectorDylan MacKenzie-421/+0
2020-03-17Use `const_eval_limit` instead of infinite loop detectorDylan MacKenzie-19/+0
2020-03-16Small fixes in documentationYoungsuk Kim-3/+3
typo fix + markdown fix for consistency
2020-03-16Auto merge of #67133 - oli-obk:it_must_be_a_sign, r=eddybbors-42/+42
Deduplicate pretty printing of constants r? @eddyb for the pretty printing logic cc @RalfJung
2020-03-14fix comment, rustfmtRalf Jung-1/+1