summary refs log tree commit diff
path: root/src/librustc_mir/const_eval
AgeCommit message (Collapse)AuthorLines
2020-01-28Auto merge of #68587 - JohnTitor:rollup-fz45xwc, r=JohnTitorbors-0/+4
Rollup of 11 pull requests Successful merges: - #68200 (Stabilize the debug_map_key_value feature) - #68383 (Clean up E0205 explanation) - #68412 (Clean up E0207 explanation) - #68454 (clean up E0214 explanation) - #68482 (clean up error codes explanation) - #68563 (Don't call `tcx.fn_sig` on closures) - #68570 (Bump LLVM submodule to fix LLVM assertion failure in MSP430 interrupt generation.) - #68571 (check_match: extract common logic) - #68573 (Clean up E0262 explanation) - #68575 (Disable the testcase for Vxworks.) - #68581 (Add support for icebreakers-cleanup-crew commands) Failed merges: r? @ghost
2020-01-27Don't call `tcx.fn_sig` on closuresAaron Hill-0/+4
Fixes #68542
2020-01-27don't clone types that are copy, round two.Matthias Krüger-2/+2
2020-01-15Promoteds can contain raw pointers, but these must still only point to ↵Oliver Scherer-4/+9
immutable allocations
2020-01-10Promote `Ref`s to constants instead of staticSantiago Pastorino-4/+14
2020-01-10Rollup merge of #67501 - oli-obk:test-slice-patterns, r=RalfJungMazdak Farrokhzad-15/+18
Reduce special treatment for zsts addresses https://github.com/rust-lang/rust/pull/67467#discussion_r360650846 cc @RalfJung
2020-01-09Switch assertion order to be more helpful to ppl that encounter themOliver Scherer-1/+1
2020-01-08Move `is_min_const_fn` query to librustc_mir.Camille GILLOT-72/+67
The only two uses of the associated methods are in librustc_mir and librustdoc. Please tell me if there is a better choice.
2020-01-08Move constness.rs to librustc_mir.Camille GILLOT-0/+156
2020-01-07Add more documentationOliver Scherer-1/+6
2020-01-07Ensure we don't accidentally turn non-zsts into zstsOliver Scherer-0/+1
2020-01-07Move `to_const_value` from `MPlaceTy` to its only use siteOliver Scherer-2/+13
2020-01-07Fix an ICE happening due code assuming that `MPlaceTy` cannot have integer ↵Oliver Scherer-16/+2
addresses
2020-01-07Automatically prefer integer addresses for zst MPlaceOliver Scherer-2/+2
2020-01-06Auto merge of #67886 - Centril:rustc_hir_canon_imports, r=nagisabors-2/+2
Nix `rustc_hir` reexports in rustc::hir r? @Zoxc cc @Mark-Simulacrum
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-2/+2
2020-01-04Rollup merge of #67137 - anp:tracked-panic-internals, r=eddybDylan DPC-1/+2
libstd uses `core::panic::Location` where possible. cc @eddyb
2020-01-04Update ABI in const impls of panic_fn/begin_panic_fn.Adam Perry-1/+2
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-2/+2
2019-12-27Fix `Instance::resolve()` incorrectly returning specialized instancesWesley Wiser-9/+13
We only want to return specializations when `Reveal::All` is passed, not when `Reveal::UserFacing` is. Resolving this fixes several issues with the `ConstProp`, `SimplifyBranches`, and `Inline` MIR optimization passes. Fixes #66901
2019-12-26Retire `to_ptr` which should already have no users but still kept getting ↵Oliver Scherer-3/+3
new ones
2019-12-26Rebase falloutOliver Scherer-3/+3
2019-12-26Bail out before running the queryOliver Scherer-3/+4
2019-12-26TidyOliver Scherer-7/+10
2019-12-26Fix imports after rebaseOliver Scherer-11/+9
2019-12-26Rename `query` moduleOliver Scherer-0/+0
2019-12-26Move function definitions before their first useOliver Scherer-138/+138
2019-12-26Move all functions used by the queries to query.rsOliver Scherer-0/+95
2019-12-26Move a function to make its adjacent impl block easier to discoverOliver Scherer-39/+43
2019-12-26Move `eval_body_using_ecx` to the only module it is used inOliver Scherer-2/+50
2019-12-26Move `eval_const_fn_call` to the `const_eval` moduleOliver Scherer-12/+43
2019-12-26Move const eval query components into their own moduleOliver Scherer-2/+230
2019-12-26Move const eval machine into its own moduleOliver Scherer-0/+358