about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
AgeCommit message (Collapse)AuthorLines
2020-03-01Auto merge of #69408 - RalfJung:canonical-alloc-id, r=oli-obkbors-45/+57
Miri: let machine canonicalize AllocIDs This implements the rustc side of the plan I laid out [here](https://github.com/rust-lang/miri/pull/1147#issuecomment-581868901). Miri PR: https://github.com/rust-lang/miri/pull/1190
2020-03-01Rollup merge of #69580 - matthiaskrgr:map_clone, r=CentrilYuki Okushi-1/+1
use .copied() instead of .map(|x| *x) on iterators
2020-03-01Auto merge of #69592 - petrochenkov:nosyntax, r=Centrilbors-6/+6
Rename `libsyntax` to `librustc_ast` This was the last rustc crate that wasn't following the `rustc_*` naming convention. Follow-up to https://github.com/rust-lang/rust/pull/67763.
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-6/+6
2020-02-29Rollup merge of #69572 - matthiaskrgr:try_err_and_iter_on_ref, r=CentrilDylan DPC-1/+1
use .iter() instead of .into_iter() on references
2020-02-29use .copied() instead of .map(|x| *x) on iteratorsMatthias Krüger-1/+1
2020-02-29downgrade some assertions to debug_ againRalf Jung-5/+7
2020-02-29use .iter() instead of .into_iter() on references.Matthias Krüger-1/+1
2020-02-28miri engine: turn some debug_assert into assertRalf Jung-14/+12
2020-02-28remove ScalarMaybeUndef::to_bits and make Scalar::to_bits privateRalf Jung-42/+38
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-3/+3
2020-02-28Auto merge of #68505 - skinny121:canonicalize-const-eval-inputs, r=nikomatsakisbors-5/+1
Canonicalize inputs to const eval where needed Canonicalize inputs to const eval, so that they can contain inference variables. Which enables invoking const eval queries even if the current param env has inference variable within it, which can occur during trait selection. This is a reattempt of #67717, in a far less invasive way. Fixes #68477 r? @nikomatsakis cc @eddyb
2020-02-27don't use .into() to convert types into identical types.Matthias Krüger-2/+2
example: let s: String = format!("hello").into();
2020-02-26miri: validity visitor comments and path printing improvementsRalf Jung-22/+45
2020-02-23fmtRalf Jung-4/+1
2020-02-23canonicalize alloc ID before calling tag_static_base_pointerRalf Jung-1/+4
2020-02-23miri/machine: add canonical_alloc_id hook to replace find_foreign_staticRalf Jung-44/+56
2020-02-20Erase regions before before performing const eval, to improve caching.Ben Lewis-5/+1
2020-02-19Check `RUSTC_CTFE_BACKTRACE` much less by generating fewer errorsWesley Wiser-6/+6
Before this change, `get_size_and_align()` calls `get_fn_alloc()` *a lot* in CTFE heavy code. This previously returned an `Error` which would check if `RUSTC_CTFE_BACKTRACE` was set on construction. Doing this turned out to be a performance hotspot as @nnethercote discovered in #68792. This is an alternate take on that PR which resolves the performance issue by generating *many* fewer errors. Previously, `ctfe-stress-4` would generate over 5,000,000 errors each of which would check for the presence of the environment variable. With these changes, that number is reduced to 30.
2020-02-18more English grammarRalf Jung-4/+4
2020-02-18miri value visitor: fix some wrong assumptions about layout; improve error ↵Ralf Jung-157/+151
messages
2020-02-16Determine type of intrinsics instead of assuming the destination type is the ↵Ben Lewis-1/+8
same.
2020-02-16Code review changes.Ben Lewis-1/+1
2020-02-15Fix emulate intrinsics return type.Ben Lewis-2/+1
2020-02-15Change const eval to return `ConstValue`, instead of `Const` as the type ↵Ben Lewis-18/+12
inside it shouldn't be used.
2020-02-13Rollup merge of #69126 - RalfJung:exact-div, r=oli-obkDylan DPC-2/+4
miri: fix exact_div Turns out `exact_div` was relying on the broken behavior of `Rem` for `int_min % -1` that was fixed in https://github.com/rust-lang/rust/pull/69002. This PR fixes `exact_div`. Inside rustc, `exact_div` is only used in a single place where the divisor is always positive (in `ptr_offset_from`), so we cannot test the fix in rustc. The Miri test suite covers this through the `exact_div` intrinsic, though (and it is how I found out). One step to https://github.com/rust-lang/rust/issues/69117 (then we also need to address build failures introduced by https://github.com/rust-lang/rust/pull/68969) r? @oli-obk
2020-02-13miri: fix exact_divRalf Jung-2/+4
2020-02-13move PanicInfo to mir moduleRalf Jung-3/+3
2020-02-13remove Panic variant from InterpErrorRalf Jung-32/+6
2020-02-12Rollup merge of #69002 - RalfJung:miri-op-overflow, r=oli-obk,wesleywiserDylan DPC-28/+46
miri: improve and simplify overflow detection This simplifies the overflow detection for signed binary operators, and adds overflow detection to unary operators so that const-prop doesn't have to crudely hand-roll that. It also fixes some bugs in the operator implementation that however, I think, were not observable. r? @oli-obk @wesleywiser
2020-02-11Invert control in struct_lint_level.jumbatm-4/+7
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-02-10remove outdated commentRalf Jung-1/+0
2020-02-09miri: equip unary_op with overflow detectionRalf Jung-9/+27
2020-02-09bring back extra check for int_min%-1Ralf Jung-0/+11
2020-02-09miri: simplify singed operator overflow detectionRalf Jung-24/+14
2020-02-04Implement remaining `unchecked` arithmetic intrinsicsDylan MacKenzie-2/+17
2020-01-31Auto merge of #67878 - Others:opt-3, r=Mark-Simulacrumbors-0/+3
Change opt-level from 2 back to 3 In Cargo.toml, the opt-level for `release` and `bench` was overridden to be 2. This was to work around a problem with LLVM 7. However, rust no longer uses LLVM 7, so this is hopefully no longer needed? I tried a little bit to replicate the original problem, and could not. I think running this through CI is the best way to smoke test this :) Even if things break dramatically, the comment should be updated to reflect that things are still broken with LLVM 9. I'm just getting started playing with the compiler, so apologies if I've missed an obvious problem here. fixes #52378 (possibly relevant is the [current update to LLVM 10](https://github.com/rust-lang/rust/pull/67759))
2020-01-30Change opt-level from 2 back to 3Gregor Peach-0/+3
In Cargo.toml, the opt-level for `release` and `bench` was overridden to be 2. This was to work around a problem with LLVM 7. However, rust no longer uses LLVM 7, so this is no longer needed. This creates a small compile time regression in MIR constant eval, so I've added a #[inline(always)] on the `step` function used in const eval Also creates a binary size increase in wasm-stringify-ints-small, so I've bumped the limit there.
2020-01-24Print constants in `type_name` for const genericsvarkor-3/+2
2020-01-17Rollup merge of #68288 - RalfJung:fmt, r=oli-obkDylan DPC-28/+20
Fix some of the rustfmt fallout in Miri re-post of https://github.com/rust-lang/rust/pull/67833 without the `rustfmt::skip` r? @oli-obk
2020-01-16adjust Deref commentRalf Jung-7/+5
2020-01-16let rustfmt undo most of my edits :(Ralf Jung-29/+16
2020-01-16fix rustfmt falloutRalf Jung-36/+43
2020-01-15Auto merge of #67603 - oli-obk:no_mut_static_ref_from_const, r=RalfJungbors-11/+35
Promoteds can contain raw pointers, but these must still only point to immutable allocations fixes #67601 r? @RalfJung cc @wesleywiser in order to not change behaviour in this PR, const prop uses the constant rules for interning, but at least there's an explicit mode for it now that we can think about this in the future
2020-01-15Address review commentsOliver Scherer-23/+3
2020-01-15TypoOliver Scherer-1/+1
2020-01-15Undo a change not neceesary for this bugfixOliver Scherer-10/+4
2020-01-15Update src/librustc_mir/interpret/intern.rsOliver Scherer-1/+2
Co-Authored-By: Ralf Jung <post@ralfj.de>
2020-01-15Clean up commentOliver Scherer-4/+4
2020-01-15Elaborate on the details in some commentsOliver Scherer-9/+20