about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
AgeCommit message (Collapse)AuthorLines
2018-04-30Merge ConstMathError into EvalErrorKindOliver Schneider-5/+3
2018-04-30Remove ConstFloatOliver Schneider-31/+32
2018-04-30Implement `PartialCmp` for `ConstFloat`Oliver Schneider-6/+6
2018-04-27Rollup merge of #49894 - Zoxc:sync-internedstring, r=michaelwoeristerkennytm-1/+1
Rename InternedString to LocalInternedString and introduce a new thread-safe InternedString This is an allocation-free alternative to https://github.com/rust-lang/rust/pull/46972.
2018-04-27Rollup merge of #50246 - nnethercote:no-dump_allocs, r=Mark-Simulacrumkennytm-6/+11
Make dump_{alloc,allocs,local}() no-ops when tracing is disabled. Because they traverse data structures and build up strings, which is wasted effort if those strings aren't printed. The patch also removes some now-unnecessary log_enabled! tests at call sites. This is a big win for the Debug and Opt runs of coercions, tuple-stress, html5ever, and encoding. ``` coercions-opt avg: -7.8% min: -14.8% max: 0.1% coercions avg: -8.0% min: -12.8% max: 0.1% tuple-stress avg: -7.2% min: -10.8% max: -0.7% tuple-stress-opt avg: -6.9% min: -10.7% max: 0.6% html5ever avg: -4.6% min: -7.3% max: -0.3% encoding avg: -2.4% min: -4.5% max: 0.1% html5ever-opt avg: -2.7% min: -4.2% max: -0.2% encoding-opt avg: -1.4% min: -2.4% max: 0.0% ```
2018-04-27Rename InternedString to LocalInternedString and introduce a new thread-safe ↵John Kåre Alsaker-1/+1
InternedString
2018-04-26Auto merge of #49513 - nox:univariant-fieldless-enum-as-zst, r=eddybbors-1/+34
Treat repr(Rust) univariant fieldless enums as ZSTs This makes all those enums be represented the same way: ```rust enum A1 { B1 } enum A2 { B2 = 0 } enum A3 { B3, C3(!) } ``` Related to #15747. Cc @rust-lang/wg-codegen @rust-lang/lang
2018-04-26rustc_target: move in syntax::abi and flip dependency.Irina Popa-1/+1
2018-04-26Treat repr(Rust) univariant fieldless enums as a ZST (fixes #15747)Anthony Ramine-1/+21
This makes all those enums be represented the same way: ```rust enum A1 { B1 } enum A2 { B2 = 0 } enum A3 { B3, C3(!) } ```
2018-04-26rustc_target: move LayoutOf's type parameter to an associated type.Irina Popa-2/+4
2018-04-26rustc_target: move in type definitions from ty::layout.Irina Popa-1/+1
2018-04-26Properly evaluate zst enumOliver Schneider-0/+10
2018-04-26Properly look for uninhabitedness when handling discriminantsAnthony Ramine-0/+3
2018-04-26Make dump_{alloc,allocs,local}() no-ops when tracing is disabled.Nicholas Nethercote-6/+11
Because they traverse data structures and build up strings, which is wasted effort if those strings aren't printed. The patch also removes some now-unnecessary log_enabled! tests at call sites.
2018-04-24Auto merge of #49933 - oli-obk:miri_rustup, r=eddybbors-38/+72
Fix the miri tool r? @eddyb cc @bjorn3 fixes #49777
2018-04-23Auto merge of #49779 - oli-obk:const_err_regression, r=eddybbors-3/+3
Don't report compile-time errors for promoteds Fixes the regression part of #49760, the missing warnings still are missing r? @eddyb
2018-04-23Fix the miri toolOliver Schneider-38/+72
2018-04-20Auto merge of #50051 - nnethercote:no-env-var, r=Mark-Simulacrumbors-5/+5
Lazily evaluate EvalErrorKind::*.into() calls. eval_context.rs calls `ok_or` in multiple places with an eagerly evaluated `EvalErrorKind::*.into()` argument, which calls EvalError::from(), which calls env::var("MIRI_BACKTRACE"), which allocates a String. This code is hot enough for this to have a measurable effect on some benchmarks. This patch changes the `ok_or` calls into `ok_or_else`, thus avoiding the evaluations when they're not needed. As a result, most of the rustc-perf benchmarks get a measurable speedup, particularly the shorter-running ones, where the improvement is as high as 6%. Output from rustc-perf, comparing stage 2 builds with jemalloc disabled: <details> ``` coercions avg: -1.8% min: -6.0% max: -0.0% helloworld-opt avg: -3.7% min: -4.0% max: -3.4% helloworld avg: -3.7% min: -3.9% max: -3.5% parser avg: -3.5% min: -3.9% max: -3.1% unify-linearly-opt avg: -3.2% min: -3.8% max: -2.8% unify-linearly avg: -3.2% min: -3.7% max: -2.8% parser-opt avg: -3.2% min: -3.6% max: -2.8% clap-rs avg: -0.9% min: -3.6% max: 0.1% encoding avg: -1.9% min: -3.0% max: -1.2% clap-rs-opt avg: -0.8% min: -2.7% max: -0.1% helloworld-check avg: -1.9% min: -2.2% max: -1.7% deeply-nested-check avg: -1.4% min: -2.1% max: -0.9% issue-46449-opt avg: -0.7% min: -2.0% max: -0.3% unify-linearly-check avg: -1.5% min: -1.9% max: -1.2% issue-46449 avg: -1.0% min: -1.8% max: -0.8% deeply-nested-opt avg: -0.7% min: -1.7% max: -0.2% deeply-nested avg: -1.0% min: -1.6% max: -0.6% parser-check avg: -1.3% min: -1.6% max: -0.8% encoding-check avg: -1.5% min: -1.6% max: -1.2% tuple-stress avg: -0.9% min: -1.5% max: 0.0% tuple-stress-opt avg: -1.0% min: -1.5% max: -0.3% issue-46449-check avg: -1.3% min: -1.4% max: -1.0% encoding-opt avg: -1.1% min: -1.2% max: -0.9% regression-31157 avg: -0.7% min: -1.2% max: -0.2% regression-31157-check avg: -0.8% min: -1.2% max: -0.5% futures-check avg: -0.8% min: -1.2% max: -0.4% unused-warnings-opt avg: -1.0% min: -1.2% max: -0.9% unused-warnings avg: -1.0% min: -1.1% max: -0.9% coercions-opt avg: -0.6% min: -1.0% max: -0.2% inflate-check avg: -0.4% min: -0.9% max: -0.1% regex-check avg: -0.8% min: -0.9% max: -0.5% piston-image-check avg: -0.8% min: -0.9% max: -0.8% deep-vector avg: -0.3% min: -0.9% max: 0.1% futures avg: -0.5% min: -0.8% max: -0.2% futures-opt avg: -0.5% min: -0.7% max: -0.1% html5ever avg: -0.6% min: -0.7% max: -0.4% tokio-webpush-simple-check avg: -0.2% min: -0.7% max: 0.1% piston-image-opt avg: -0.3% min: -0.7% max: -0.1% regex avg: -0.4% min: -0.7% max: -0.1% piston-image avg: -0.4% min: -0.7% max: -0.2% regex-opt avg: -0.3% min: -0.7% max: 0.1% tokio-webpush-simple-opt avg: -0.2% min: -0.6% max: 0.0% coercions-check avg: -0.3% min: -0.6% max: -0.1% hyper avg: -0.4% min: -0.6% max: -0.2% syn-opt avg: -0.3% min: -0.6% max: -0.0% hyper-check avg: -0.5% min: -0.6% max: -0.3% syn-check avg: -0.4% min: -0.5% max: -0.2% hyper-opt avg: -0.3% min: -0.5% max: -0.1% html5ever-opt avg: -0.3% min: -0.5% max: -0.2% syn avg: -0.2% min: -0.4% max: -0.1% deep-vector-opt avg: -0.2% min: -0.4% max: 0.1% tokio-webpush-simple avg: -0.2% min: -0.4% max: -0.1% inflate avg: -0.2% min: -0.4% max: -0.1% inflate-opt avg: -0.2% min: -0.4% max: -0.0% regression-31157-opt avg: -0.1% min: -0.4% max: 0.0% html5ever-check avg: -0.3% min: -0.4% max: -0.2% unused-warnings-check avg: -0.2% min: -0.3% max: -0.2% script-servo-check avg: -0.1% min: -0.3% max: 0.0% crates.io-check avg: -0.2% min: -0.3% max: -0.0% script-servo avg: -0.1% min: -0.2% max: 0.0% clap-rs-check avg: 0.0% min: -0.1% max: 0.2% deep-vector-check avg: -0.0% min: -0.2% max: 0.2% tuple-stress-check avg: -0.1% min: -0.2% max: 0.0% crates.io-opt avg: -0.1% min: -0.2% max: 0.0% crates.io avg: -0.1% min: -0.2% max: -0.0% script-servo-opt avg: -0.0% min: -0.1% max: 0.0% ``` </details>
2018-04-19Sign extend constants in range patternsOliver Schneider-12/+26
2018-04-19Lazily evaluate EvalErrorKind::*.into() calls.Nicholas Nethercote-5/+5
eval_context.rs calls `ok_or` in multiple places with an eagerly evaluated `EvalErrorKind::*.into()` argument, which calls EvalError::from(), which calls env::var("MIRI_BACKTRACE"), which allocates a String. This code is hot enough for this to have a measurable effect on some benchmarks. This patch changes the `ok_or` calls into `ok_or_else`, thus avoiding the evaluations when they're not needed. As a result, most of the rustc-perf benchmarks get a measurable speedup, particularly the shorter-running ones, where the improvement is as high as 6%.
2018-04-15Auto merge of #49947 - oli-obk:turing_complete_const_eval, r=nagisabors-10/+10
Don't abort const eval due to long running evals, just warn one check-box of #49930 r? @nagisa (https://github.com/rust-lang/rfcs/pull/2344#issuecomment-368246665)
2018-04-15Only warn on erroneous promoted constantsOliver Schneider-3/+3
2018-04-15Add a tracking issue for making the warning a lintOliver Schneider-0/+1
2018-04-14Stop referring to statics' AllocIds directlyOliver Schneider-113/+37
2018-04-13Don't abort const eval due to long running evals, just warnOliver Schneider-10/+9
2018-04-10Remove Cell from const_eval_stack_frame_limit and const_eval_step_limitJohn Kåre Alsaker-2/+2
2018-04-07miri: Make write_discriminant_value publicbjorn3-1/+1
2018-04-05Rollup merge of #49625 - bjorn3:miri_access_memory_kind, r=oli-obkkennytm-0/+4
miri: add public alloc_kind accessor
2018-04-04miri: add public alloc_kind accessorbjorn3-0/+4
2018-04-04Rollup merge of #49540 - bjorn3:fix_miri_discriminant, r=oli-obkkennytm-10/+19
Fix miri Discriminant() for non-ADT Fixes #49327
2018-04-01Fix miri Discriminant() for non-ADTbjorn3-10/+19
2018-03-30Add an explanation for the `create_depgraph_edges`Oliver Schneider-1/+12
2018-03-30Introduce an edge from a const eval to the MIR of all statics it depends onOliver Schneider-1/+29
2018-03-25Rollup merge of #49274 - oli-obk:slow_miri, r=michaelwoerister,eddybkennytm-58/+44
Remove slow HashSet during miri stack frame creation fixes #49237 probably has a major impact on #48846 r? @michaelwoerister cc @eddyb I know you kept telling me to use vectors instead of hash containers... Now I know why.
2018-03-24Auto merge of #48482 - davidtwco:issue-47184, r=nikomatsakisbors-0/+2
NLL should identify and respect the lifetime annotations that the user wrote Part of #47184. r? @nikomatsakis
2018-03-23Rollup merge of #49030 - Zoxc:misc, r=michaelwoeristerAlex Crichton-3/+3
Misc changes from my parallel rustc branch r? @michaelwoerister
2018-03-23Simplify local accessorsOliver Schneider-10/+8
2018-03-23Don't allocate a local array at all if there are no localsOliver Schneider-16/+22
2018-03-23Replace uses of `Hash(Map|Set)` with `FxHash(Map|Set)` in miriOliver Schneider-8/+9
2018-03-23Vec<_> -> IndexVec<Local, _>Oliver Schneider-22/+14
2018-03-22Added UserAssertTy statement.David Wood-0/+2
2018-03-22Skip checking for Storage* statements in constants/staticsOliver Schneider-10/+17
2018-03-22Remove slow HashSet during miri stack frame creationOliver Schneider-29/+11
2018-03-21Fix test errorbjorn3-0/+8
2018-03-20Don't check interpret_interner when accessing a static to fix miri mutable ↵bjorn3-22/+10
statics
2018-03-17Replace Rc with LrcJohn Kåre Alsaker-3/+3
2018-03-14Auto merge of #47630 - canndrew:exhaustive-patterns, r=nikomatsakisbors-1/+1
Stabilise feature(never_type). Introduce feature(exhaustive_patterns) This stabilizes `!`, removing the feature gate as well as the old defaulting-to-`()` behavior. The pattern exhaustiveness checks which were covered by `feature(never_type)` have been moved behind a new `feature(exhaustive_patterns)` gate.
2018-03-14Auto merge of #48864 - oli-obk:miri_incremental_regression, r=eddybbors-2/+6
Cache const eval queries fixes #48846 (I think, still running more perf tests, but tuple-stress stops recomputing any constants) r? @michaelwoerister
2018-03-14remove defaulting to unitAndrew Cann-1/+1
Types will no longer default to `()`, instead always defaulting to `!`. This disables the associated warning and removes the flag from TyTuple
2018-03-13`trans_apply_param_substs` => `subst_and_normalize_erasing_regions`Niko Matsakis-3/+15
Consolidate `trans_apply_param_substs` and `trans_apply_param_substs_env`. Also remove `trans_impl_self_ty`