summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval
AgeCommit message (Collapse)AuthorLines
2020-12-02rename MemoryKind::Heap to ConstHeap; bless testVishnunarayan K I-6/+13
2020-12-02add comment and bless some testsVishnunarayan K I-23/+20
2020-12-01review comment and one more testVishnunarayan K I-11/+23
2020-12-01review commentsVishnunarayan K I-1/+43
2020-12-01add const_allocate intrisicVishnunarayan K I-0/+79
2020-11-29Update tests to remove old numeric constantsbstrie-47/+32
Part of #68490. Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros. For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
2020-11-12fix tests and formattingVishnunarayan K I-20/+4
2020-10-22Add test for const panic!(CONST).Mara Bos-17/+45
2020-10-18we can test std and core panic macros togetherRalf Jung-70/+90
2020-10-04But whateverecstatic-morse-0/+1
2020-10-03Ensure that the const-eval engine handles `#[unwind(aborts)]`Dylan MacKenzie-0/+33
2020-09-29Bless outputDylan MacKenzie-1/+1
2020-09-29Bless mut testsDylan MacKenzie-24/+11
2020-09-29Auto merge of #76754 - varkor:diagnostic-cleanup-ii, r=ecstatic-morsebors-57/+57
Clean up diagnostics for arithmetic operation errors Plus a small tweak to a range pattern error message.
2020-09-27Bless testsDylan MacKenzie-1/+23
2020-09-27Update tests with new feature gateDylan MacKenzie-1/+1
2020-09-26Make invalid integer operation messages consistentvarkor-57/+57
2020-09-19Reflect the "do not call this query directly" mentality in its nameOliver Scherer-2/+2
2020-09-19Address review commentsOliver Scherer-3/+3
2020-09-19Fix rebase fallout and make the test work with debug infoOliver Scherer-3/+3
2020-09-19We can make const eval sound, it's just super expensiveOliver Scherer-7/+3
2020-09-19Clarify a statement in UB testOliver Scherer-1/+3
2020-09-19Stop using the `const_eval` query for initializers of staticsOliver Scherer-12/+12
As a side effect, we now represent most promoteds as `ConstValue::Scalar` again. This is useful because all implict promoteds are just references anyway and most explicit promoteds are numeric arguments to `asm!` or SIMD instructions.
2020-09-19Validate constants during `const_eval_raw`Oliver Scherer-28/+17
2020-09-02pretty: trim paths of unique symbolsDan Aloni-2/+2
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-08-27Abort when catch_unwind catches a foreign exceptionAmanieu d'Antras-0/+2
2020-08-21Extend normalization in const-eval-query-stack testTomasz Miąsko-2/+3
Builds with debuginfo have additional information in backtrace.
2020-08-20Set RUST_BACKTRACE env variableThibsG-1/+2
2020-08-19Fix bad printing of const-eval queriesThibsG-0/+38
2020-08-12more precise span for erroneous consts during CTFE/MiriRalf Jung-10/+6
2020-08-12bless testsRalf Jung-5/+7
2020-08-10add test for unused erroneous const in CTFERalf Jung-0/+63
2020-07-22Optimize away BitAnd and BitOr when possibleXavier Denis-3/+4
2020-07-11Rollup merge of #72920 - oli-obk:const_transmute, r=RalfJungManish Goregaokar-59/+63
Stabilize `transmute` in constants and statics but not const fn cc #53605 (leaving issue open so we can add `transmute` to `const fn` later) Previous attempt: #64011 r? @RalfJung cc @rust-lang/wg-const-eval
2020-07-11Stabilize `transmute` in constants and statics but not const fnOliver Scherer-59/+63
2020-07-10Rollup merge of #73989 - RalfJung:ub-enum-test, r=oli-obkManish Goregaokar-8/+9
adjust ub-enum test to be endianess-independent @cuviper noted that our test fails on "other" endianess systems (I never know which is which^^), so let's fix that.
2020-07-05const validation: add test for uninit boolRalf Jung-2/+13
2020-07-05catch errors more locally around read_discriminantRalf Jung-3/+3
2020-07-03adjust ub-enum test to be endianess-independentRalf Jung-8/+9
2020-06-28Update testsDylan MacKenzie-87/+10
2020-06-28Update testsDylan MacKenzie-31/+2
2020-06-26Show the values and computation that would overflow a const evaluation or ↵Oliver Scherer-50/+50
propagation
2020-06-23Rollup merge of #73515 - christianpoveda:livedrop-diagnostics, r=oli-obkManish Goregaokar-4/+47
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-49/+53
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-20update testsChristian Poveda-4/+47
2020-06-20Satisfy tidyOliver Scherer-2/+2
2020-06-20Refer just to the issue in the raw ptr cmp diagnostic instead of explaining ↵Oliver Scherer-8/+4
everything in the diagnostic
2020-06-19add new error codeChristian Poveda-3/+3
2020-06-19update diagnostics for &mut in constantsChristian Poveda-8/+5
2020-06-19Add fuzzy pointer comparison intrinsicsOliver Scherer-4/+6