about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
AgeCommit message (Collapse)AuthorLines
2020-01-15Elaborate on commentsOliver Scherer-0/+14
2020-01-15Promoteds can contain raw pointers, but these must still only point to ↵Oliver Scherer-12/+36
immutable allocations
2020-01-14Untangle ZST validation from integer validation and generalize it to all zstsOliver Scherer-11/+7
2020-01-13Auto merge of #68088 - oli-obk:fix_miri, r=RalfJungbors-3/+8
Don't try to force_ptr pointers to zsts r? @RalfJung cc @wesleywiser This is required to fix miri after https://github.com/rust-lang/rust/pull/67501 broke it. The reason only miri sees this is that it uses validation on values during interpretation and not just on the final value of constants, which never contain such values.
2020-01-13Early abort validation of arrays of zsts because there is no data to be checkedOliver Scherer-3/+8
2020-01-10Remove an outdated commentOliver Scherer-1/+0
2020-01-10Promoteds also need param envs.Oliver Scherer-13/+15
This also allows us to use the `const_eval` query again without causing cycles
2020-01-10Remove PlaceBase enum and make Place base field be local: LocalSantiago Pastorino-13/+9
2020-01-10Remove Static from PlaceBaseSantiago Pastorino-32/+0
2020-01-10Remove StaticKindSantiago Pastorino-28/+22
2020-01-10Remove StaticKind::PromotedSantiago Pastorino-16/+3
2020-01-10Promote `Ref`s to constants instead of staticSantiago Pastorino-9/+18
2020-01-10Revert const_eval call to use const_eval_raw to avoid const validation cyclesSantiago Pastorino-1/+6
2020-01-09Rename `Unsized` to `Meta`Oliver Scherer-22/+22
2020-01-09Update src/librustc_mir/interpret/place.rsOliver Scherer-0/+1
Co-Authored-By: Ralf Jung <post@ralfj.de>
2020-01-07Actually use the poison valueOliver Scherer-7/+3
2020-01-07Add more documentationOliver Scherer-0/+2
2020-01-07Add warning label to `try_as_mplace`Oliver Scherer-0/+4
2020-01-07Remove a bunch of dead functions and make some functions privateOliver Scherer-37/+3
2020-01-07Poison any `MemPlace` created from a zst Operand (or otherwise via ↵Oliver Scherer-43/+102
`MPlaceTy::dangling`) so you can't get the address back out.
2020-01-07Move `to_const_value` from `MPlaceTy` to its only use siteOliver Scherer-16/+1
2020-01-07Fix an ICE happening due code assuming that `MPlaceTy` cannot have integer ↵Oliver Scherer-3/+23
addresses
2020-01-07Remove a ZST special casing that is not necessary anymoreOliver Scherer-6/+2
2020-01-07Automatically prefer integer addresses for zst MPlaceOliver Scherer-50/+22
2020-01-06Auto merge of #67886 - Centril:rustc_hir_canon_imports, r=nagisabors-7/+7
Nix `rustc_hir` reexports in rustc::hir r? @Zoxc cc @Mark-Simulacrum
2020-01-05Use Instance.ty_env instead of Instance.monomorphic_ty in interpreterAaron Hill-1/+1
2020-01-05Rename Instance.ty to Instance.monomorphic_tyAaron Hill-1/+1
2020-01-05Fix ICE involving calling `Instance.ty` during const evaluationAaron Hill-1/+1
Fixes #67639 `Instance.ty` assumes that we are in a fully monomorphic context (e.g. codegen), and can therefore use an empty `ParamEnv` when performing normalization. Howver, the MIR constant evaluator code ends up calling `Instance.ty` as a result of us attemptign to 'speculatively' const-evaluate generic functions during const propagation. As a result, we may end up with projections involving type parameters (e.g. <T as MyTrait>::Bar>) in the type we are trying to normalize. Normalization expects us to have proper predicates in the `ParamEnv` for such projections, and will ICE if we don't. This commit adds a new method `Instance.ty_env`, which takes a `ParamEnv` for use during normalization. The MIR const-evaluator code is changed to use this method, passing in the proper `ParamEnv` for the context at hand.
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-7/+7
2020-01-04Rollup merge of #67137 - anp:tracked-panic-internals, r=eddybDylan DPC-38/+19
libstd uses `core::panic::Location` where possible. cc @eddyb
2020-01-04Restrict visibility of location_triple_for_span.Adam Perry-1/+1
2020-01-04Update ABI in const impls of panic_fn/begin_panic_fn.Adam Perry-38/+19
2020-01-04core and std macros and panic internals use panic::Location::caller.Adam Perry-1/+1
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-3/+3
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-6/+6
2019-12-30Auto merge of #67667 - wesleywiser:speed_up_trivially_valid_constants, r=oli-obkbors-3/+12
Resolve long compile times when evaluating always valid constants This extends the existing logic which skips validating every integer or floating point number type to also skip validating empty structs because they are also trivially valid. Fixes #67539 r? @oli-obk cc @RalfJung @spastorino
2019-12-29Resolve long compile times when evaluating always valid constantsWesley Wiser-3/+12
This extends the existing logic which skips validating every integer or floating point number type to also skip validating empty structs because they are also trivially valid. Fixes #67539
2019-12-28Avoid copying some undef memory in MIRSantiago Pastorino-24/+28
During MIR interpretation it may happen that a place containing uninitialized bytes is copied. This would read the current representation of these bytes and write it to the destination even though they must, by definition, not matter to the execution. This elides that representation change when no bytes are defined in such a copy, saving some cpu cycles. In such a case, the memory of the target allocation is not touched at all which also means that sometimes no physical page backing the memory allocation of the representation needs to be provided by the OS at all, reducing memory pressure on the system.
2019-12-27Avoid memory copy logic for zstsSantiago Pastorino-1/+9
Closes #67539
2019-12-26Fix rebase falloutOliver Scherer-1/+6
2019-12-26Use the targetted const eval functionsOliver Scherer-9/+5
2019-12-26Reintroduce the recursion commentOliver Scherer-0/+4
2019-12-26Documentation nitOliver Scherer-1/+2
2019-12-26Add a `const_eval` helper to `InterpCx`Oliver Scherer-20/+23
2019-12-26Explain why `const_eval` is ok hereOliver Scherer-0/+7
2019-12-26TypoOliver Scherer-1/+1
2019-12-26Remove unintended noisy log statementOliver Scherer-1/+1
2019-12-26Explain the currently necessary existance of `TransmuteSizeDiff`Oliver Scherer-0/+4
2019-12-26Explain what we are doing with parameter environments for staticsOliver Scherer-5/+5