about summary refs log tree commit diff
path: root/src/librustc_mir/transform/check_consts
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-1707/+0
2020-08-24hir: consistent use and naming of lang itemsDavid Wood-2/+2
This commit adjusts the naming of various lang items so that they are consistent and don't include prefixes containing the target or "LangItem". In addition, lang item variants are no longer exported from the `lang_items` module. Signed-off-by: David Wood <david@davidtw.co>
2020-08-18Moved coverage counter injection from BasicBlock to Statement.Rich Kadel-0/+1
2020-08-13merge `as_local_hir_id` with `local_def_id_to_hir_id`Bastian Kauschke-1/+1
2020-07-15update const arg queriesBastian Kauschke-2/+2
2020-07-15const generics work!Bastian Kauschke-1/+6
2020-07-15InstanceDef::ItemBastian Kauschke-2/+2
2020-07-15ConstKind::UnevaluatedBastian Kauschke-3/+3
2020-07-04nitBastian Kauschke-1/+1
Co-authored-by: varkor <github@varkor.com>
2020-07-04ConstCx to LocalDefIdBastian Kauschke-19/+13
2020-07-01Rollup merge of #73778 - nbdd0121:const_likely, r=oli-obkManish Goregaokar-2/+5
Make `likely` and `unlikely` const, gated by feature `const_unlikely` This PR also contains a fix to allow `#[allow_internal_unstable]` to work properly with `#[rustc_const_unstable]`. cc @RalfJung @nagisa r? @oli-obk
2020-06-28Stop checking for `while` and `loop` in a const contextDylan MacKenzie-19/+0
2020-06-28MIR const-checkingDylan MacKenzie-23/+1
2020-06-28Remove `control_flow_destroyed` and properly lower `&&` and `||`Dylan MacKenzie-40/+0
2020-06-27Fix ICE for lib featuresGary Guo-2/+2
2020-06-26Fix allow_internal_unstable with rustc_const_unstableGary Guo-2/+5
2020-06-23Auto merge of #73643 - Manishearth:rollup-68dr8fz, r=Manishearthbors-18/+22
Rollup of 9 pull requests Successful merges: - #72271 (Improve compiler error message for wrong generic parameter order) - #72493 ( move leak-check to during coherence, candidate eval) - #73398 (A way forward for pointer equality in const eval) - #73472 (Clean up E0689 explanation) - #73496 (Account for multiple impl/dyn Trait in return type when suggesting `'_`) - #73515 (Add second message for LiveDrop errors) - #73567 (Clarify --extern documentation.) - #73572 (Fix typos in doc comments) - #73590 (bootstrap: no `config.toml` exists regression) Failed merges: r? @ghost
2020-06-23Rollup merge of #73515 - christianpoveda:livedrop-diagnostics, r=oli-obkManish Goregaokar-7/+13
Add second message for LiveDrop errors This is an attempt to fix https://github.com/rust-lang/rust/issues/72907 by adding a second message to the `LiveDrop` diagnostics. Changing from this ``` error[E0493]: destructors cannot be evaluated at compile-time --> src/lib.rs:7:9 | 7 | let mut always_returned = None; | ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors error: aborting due to previous error ``` to this ``` error[E0493]: destructors cannot be evaluated at compile-time --> foo.rs:6:9 | 6 | let mut always_returned = None; | ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors ... 10 | always_returned = never_returned; | --------------- value is dropped here error: aborting due to previous error ``` r? @RalfJung @ecstatic-morse
2020-06-23Rollup merge of #73398 - oli-obk:const_raw_ptr_cmp, r=varkor,RalfJung,nagisaManish Goregaokar-11/+9
A way forward for pointer equality in const eval r? @varkor on the first commit and @RalfJung on the second commit cc #53020
2020-06-21Make is_freeze and is_copy_modulo_regions take TyCtxtAtRalf Jung-1/+1
2020-06-20Satisfy tidyOliver Scherer-4/+4
2020-06-20Refer just to the issue in the raw ptr cmp diagnostic instead of explaining ↵Oliver Scherer-15/+1
everything in the diagnostic
2020-06-19add second message for livedrop errorsChristian Poveda-7/+13
2020-06-19add new error codeChristian Poveda-1/+1
2020-06-19update diagnostics for &mut in constantsChristian Poveda-11/+17
2020-06-19forbid mutable references in all constants except const fnsChristian Poveda-0/+6
2020-06-19Add fuzzy pointer comparison intrinsicsOliver Scherer-8/+14
2020-06-19Remove the const_raw_ptr_comparison feature gate.Oliver Scherer-10/+16
We can never supply a meaningful implementation of this. Instead, the follow up commits will create two intrinsics that approximate comparisons: * `ptr_maybe_eq` * `ptr_maybe_ne` The fact that `ptr_maybe_eq(a, b)` is not necessarily the same value as `!ptr_maybe_ne(a, b)` is a symptom of this entire problem.
2020-06-16rename location field of Drop terminators to placeRalf Jung-7/+6
2020-06-16remove visit_terminator_kind from MIR visitorRalf Jung-3/+4
2020-06-15Rollup merge of #71824 - ecstatic-morse:const-check-post-drop-elab, r=oli-obkRalf Jung-25/+152
Check for live drops in constants after drop elaboration Resolves #66753. This PR splits the MIR "optimization" pass series in two and introduces a query–`mir_drops_elaborated_and_const_checked`–that holds the result of the `post_borrowck_cleanup` analyses and checks for live drops. This query is invoked in `rustc_interface` for all items requiring const-checking, which means we now do `post_borrowck_cleanup` for items even if they are unused in the crate. As a result, we are now more precise about when drops are live. This is because drop elaboration can e.g. eliminate drops of a local when all its fields are moved from. This does not mean we are doing value-based analysis on move paths, however; Storing a `Some(CustomDropImpl)` into a field of a local will still set the qualifs for that entire local. r? @oli-obk
2020-06-13Add `CheckLiveDrops` passDylan MacKenzie-0/+126
2020-06-13Make `Qualifs` getters publicDylan MacKenzie-3/+3
2020-06-13Move `check_op` logic to `ops` moduleDylan MacKenzie-22/+23
2020-06-12Helper method for whether type has structural equalityDylan MacKenzie-5/+1
This helper method works for all types, falling back to a query for `TyKind::Adt`s to determine whether the implement the `{Partial,}StructuralEq` traits.
2020-06-07rename FalseEdges -> FalseEdgeRalf Jung-1/+1
2020-06-01test miri-unleash TLS accessesRalf Jung-10/+1
2020-05-30Make TLS accesses explicit in MIROliver Scherer-6/+10
2020-05-23take mir::PlaceElem by valueBastian Kauschke-3/+3
2020-05-18Add asm! to MIRAmanieu d'Antras-0/+4
2020-05-09Rollup merge of #71942 - nnethercote:shrink-LocalDecl, r=matthewjasperDylan DPC-1/+1
Shrink `LocalDecl` `LocalDecl` contributes 4-8% of peak heap memory usage on a range of benchmarks. This PR reduces its size from 128 bytes to 56 bytes on 64-bit, and does some clean-ups as well. r? @matthewjasper
2020-05-08Rollup merge of #71989 - ecstatic-morse:const-context-enum, r=oli-obkDylan DPC-81/+19
Use a single enum for the kind of a const context This adds a `ConstContext` enum to the `rustc_hir` crate and method that can be called via `tcx.hir()` to get the `ConstContext` for a given body owner. This arose from discussion in #71824. r? @oli-obk
2020-05-07Use `hir::ConstContext` instead of local enumsDylan MacKenzie-81/+19
2020-05-06Rollup merge of #71893 - ecstatic-morse:dataflow-impls-import, r=jonas-schievinkDylan DPC-1/+1
Use the `impls` module to import pre-existing dataflow analyses Currently, existing analyses live in the same module as the traits and types used to define new dataflow analyses. This muddles the [documentation for the `dataflow` module](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/dataflow/index.html). After this PR, `dataflow::impls` will refer to concrete dataflow analyses, and `dataflow` to the generic interface.
2020-05-06Shrink `LocalDecl` by 56 bytes.Nicholas Nethercote-1/+1
By boxing `local_info`.
2020-05-05Rollup merge of #71902 - mibac138:const-feature-diag, r=varkorDylan DPC-0/+3
Suggest to add missing feature when using gated const features Fixes #71797
2020-05-04Suggest to add missing feature when using gated const featuresmibac138-0/+3
2020-05-04Import dataflow impls via the `impls` submoduleDylan MacKenzie-1/+1
2020-05-03Auto merge of #71631 - RalfJung:miri-unleash-the-gates, r=oli-obkbors-4/+4
Miri: unleash all feature gates IMO it is silly to unleash features that do not even have a feature gate yet, but not unleash features that do. The only thing this achieves is making unleashed mode annoying to use as we have to figure out the feature flags to enable (and not always do the error messages say what that flag is). Given that the point of `-Z unleash-the-miri-inside-of-you` is to debug the Miri internals, I see no good reason for this extra hurdle. I cannot imagine a situation where we'd use that flag, realize the program also requires some feature gate, and then be like "oh I guess if this feature is unstable I will do something else". Instead, we'll always just add that flag to the code as well, so requiring the flag achieves nothing. r? @oli-obk @ecstatic-morse Fixes https://github.com/rust-lang/rust/issues/71630
2020-05-03Reflect API changes on current masterDylan MacKenzie-1/+1