about summary refs log tree commit diff
path: root/src/librustc_mir/transform/check_consts/ops.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-393/+0
2020-06-28Stop checking for `while` and `loop` in a const contextDylan MacKenzie-13/+0
2020-06-28MIR const-checkingDylan MacKenzie-13/+0
2020-06-23Rollup merge of #73515 - christianpoveda:livedrop-diagnostics, r=oli-obkManish Goregaokar-5/+8
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-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-5/+8
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-13Move `check_op` logic to `ops` moduleDylan MacKenzie-0/+16
2020-06-01test miri-unleash TLS accessesRalf Jung-5/+0
2020-05-08Rollup merge of #71989 - ecstatic-morse:const-context-enum, r=oli-obkDylan DPC-3/+4
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-3/+4
2020-05-04Suggest to add missing feature when using gated const featuresmibac138-0/+3
2020-04-29Allow `Downcast` projections unconditionallyDylan MacKenzie-9/+0
2020-04-23Rename `Item` to `ConstCx`.Oliver Scherer-62/+62
This renaming was already done in some modules via import renaming. It's strictly used as a context, and it contains a `TyCtxt`.
2020-04-19Check for `llvm_asm` in a const contextDylan MacKenzie-0/+4
2020-04-18miri-unleashed: test that we detect heap allocationsRalf Jung-2/+0
2020-04-15remove an impossible branch from check_constsRalf Jung-10/+0
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-2/+2
2020-03-14Return feature gate as a `Symbol`Dylan MacKenzie-28/+31
2020-02-27Remove unneeded calls to format!()Björn Steinbrink-4/+2
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-2/+0
2020-01-11Rollup merge of #68079 - varkor:E0013-clarify, r=CentrilMazdak Farrokhzad-5/+7
Clarify suggestion for E0013 Fixes https://github.com/rust-lang/rust/issues/68038.
2020-01-11simplify feature_err importsMazdak Farrokhzad-1/+1
2020-01-10Clarify suggestion for E0013varkor-5/+7
2020-01-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-10/+8
- remove syntax::{help!, span_help!, span_note!} - remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!} - lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints - inline syntax::{struct_span_warn!, diagnostic_used!} - stringify_error_code! -> error_code! & use it more. - find_plugin_registrar: de-fatalize an error - de-fatalize metadata errors - move type_error_struct! to rustc_typeck - struct_span_err! -> rustc_errors
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-22Format the worldMark Rousskov-59/+85
2019-12-18Add Rvalue::AddressOf to MIRMatthew Jasper-0/+17
This operator creates a raw pointer to a Place directly, without first creating a reference. See RFC #2582 for motivation. The Rvalue is currently unused.
2019-12-13Put MIR checks for loops behind the feature flagDylan MacKenzie-0/+4
2019-12-06Rollup merge of #66606 - christianpoveda:mut-refs-in-const-fn, r=oli-obkMazdak Farrokhzad-25/+39
Add feature gate for mut refs in const fn r? @oli-obk
2019-12-03Check intrinsics for callability in const fnsMahmut Bulut-16/+0
2019-12-02Suggest feature for const_mut_refs errorsChristian Poveda-3/+7
2019-12-02Disallow cell borrowingChristian Poveda-24/+26
2019-12-02Allow mutable derefs with feature gateChristian Poveda-1/+5
2019-12-02Allow mutable borrows in constant bodiesChristian Poveda-0/+4
2019-11-30move GateIssue to rustc_feature & simplify emit_feature_errMazdak Farrokhzad-24/+24
2019-11-21Allow `Downcast` projections if `const_if_match` enabledDylan MacKenzie-1/+5
These are generated when matching on enum variants to extract the value within. We should have no problem evaluating these, but care should be taken that we aren't accidentally allowing some other operation.
2019-11-21Add feature gate for const `if` and `match`Dylan MacKenzie-0/+4
2019-11-15Move `delay_span_bug` into `emit_error` for if/loopDylan MacKenzie-2/+18
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-0/+2
2019-10-25Make `check_consts::Item` work on non-const fnsDylan MacKenzie-17/+16
This was originally only needed for validation, which is never run on non-const `fn`s. The new promotion pass wants to use it, however.
2019-09-28Add description for every module in `check_consts`Dylan MacKenzie-0/+2