summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval
AgeCommit message (Collapse)AuthorLines
2020-05-30miri validation: clarify valid values of 'char'Ralf Jung-1/+1
2020-05-17Don't unleash NRVO const-eval testDylan MacKenzie-0/+26
2020-05-14Rollup merge of #71741 - RalfJung:pointer-print, r=oli-obkRalf Jung-14/+14
Pointer printing: do not print 0 offset r? @eddyb Cc @oli-obk
2020-05-12Pointer printing: do not print 0 offsetRalf Jung-14/+14
2020-05-12strings do not have to be valid UTF-8 any moreRalf Jung-8/+8
2020-05-07use hex for pointers in Miri error messages; refine vtable error messageRalf Jung-3/+3
2020-05-06more precise vtable errorsRalf Jung-9/+9
2020-05-06convert remaining try_validation to new macroRalf Jung-5/+35
2020-05-06add test for insufficiently aligned vtableRalf Jung-6/+16
2020-05-05Rollup merge of #71902 - mibac138:const-feature-diag, r=varkorDylan DPC-0/+4
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/+4
2020-05-03Auto merge of #71631 - RalfJung:miri-unleash-the-gates, r=oli-obkbors-16/+19
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-03warn about each skipped feature gateRalf Jung-38/+32
2020-05-01rename InvalidIntPtrUsageRalf Jung-3/+3
2020-05-01bless youRalf Jung-1/+1
2020-04-30deduplicate warningsRalf Jung-25/+34
2020-04-27keep 'pointer' terminology aroundRalf Jung-14/+14
2020-04-26organize Debug/Display impls a bit more; avoid sign-ignorant decimal displayRalf Jung-37/+38
2020-04-24adjust testsRalf Jung-4/+2
2020-04-20Treat RETURN_PLACE as a normal LocalJonas Schievink-1/+1
Copy its value to the `return_place` upon leaving a call frame
2020-04-19Fix some tests failing in `--pass check` modeVadim Petrochenkov-1/+1
2020-04-17Auto merge of #71049 - eddyb:const-err, r=oli-obkbors-50/+6
Add `ConstKind::Error` and convert `ErrorHandled::Reported` to it. By replicating the `ty::Error` approach to encoding "an error has occurred", all of the mechanisms that skip redundant/downstream errors are engaged and help out (see the reduction in test output). This PR also adds `ErrorHandled::Linted` for the lint case because using `ErrorHandled::Reported` *without* having emitted an error that is *guaranteed* to stop compilation, is incorrect now. r? @oli-obk cc @rust-lang/wg-const-eval @varkor @yodaldevoid
2020-04-16ty: convert `ErrorHandled::Reported` to `ConstKind::Error`.Eduard-Mihai Burtescu-50/+6
2020-04-16test fast path offset reportingRalf Jung-2/+112
2020-04-16switch back to 'bytes'Ralf Jung-1/+1
2020-04-15reword Miri validity errors: undefined -> uninitializedRalf Jung-3/+3
2020-04-14typeck: workaround WF hole in `to_const`.Eduard-Mihai Burtescu-2/+20
2020-04-11rustc: Add a warning count upon completionRoccoDev-7/+21
2020-04-05add testRalf Jung-0/+14
2020-04-05add testRalf Jung-0/+10
2020-03-31const backtrace: do not skip first frameRalf Jung-0/+1
2020-03-30bless testsRalf Jung-1/+1
2020-03-24bless; add test for mutating a staticRalf Jung-1/+1
2020-03-24Rollup merge of #70087 - ecstatic-morse:remove-const-eval-loop-detector, ↵Mazdak Farrokhzad-35/+7
r=RalfJung Remove const eval loop detector Now that there is a configurable instruction limit for CTFE (see #67260), we can replace the loop detector with something much simpler. See #66946 for more discussion about this. Although the instruction limit is nightly-only, the only practical way to reach the default limit uses nightly-only features as well (although CTFE will still execute code using such features inside an array initializer on stable). This will at the very least require a crater run, since it will result in an error wherever the "long running const eval" warning appeared before. We may need to increase the default for `const_eval_limit` to work around this. Resolves #54384 cc #49980 r? @oli-obk cc @RalfJung
2020-03-23Evaluate repeat expression lengths as late as possibleOliver Scherer-27/+53
2020-03-22Rename `TimeLimitReached` -> `StepLimitReached`Dylan MacKenzie-2/+2
2020-03-18Rollup merge of #69839 - RalfJung:miri-error-cleanup, r=oli-obkMazdak Farrokhzad-29/+29
Miri error reform Some time ago we started moving Miri errors into a few distinct categories, but we never classified all the old errors. That's what this PR does. ~~This is on top of https://github.com/rust-lang/rust/pull/69762; [relative diff](https://github.com/RalfJung/rust/compare/validity-errors...RalfJung:miri-error-cleanup).~~ r? @oli-obk Fixes https://github.com/rust-lang/const-eval/issues/4
2020-03-17Update const-eval testsDylan MacKenzie-35/+7
2020-03-13Auto merge of #67502 - Mark-Simulacrum:opt-catch, r=Mark-Simulacrumbors-2/+0
Optimize catch_unwind to match C++ try/catch This refactors the implementation of catching unwinds to allow LLVM to inline the "try" closure directly into the happy path, avoiding indirection. This means that the catch_unwind implementation is (after this PR) zero-cost unless a panic is thrown. https://rust.godbolt.org/z/cZcUSB is an example of the current codegen in a simple case. Notably, the codegen is *exactly the same* if `-Cpanic=abort` is passed, which is clearly not great. This PR, on the other hand, generates the following assembly: ```asm # -Cpanic=unwind: push rbx mov ebx,0x2a call QWORD PTR [rip+0x1c53c] # <happy> mov eax,ebx pop rbx ret mov rdi,rax call QWORD PTR [rip+0x1c537] # cleanup function call call QWORD PTR [rip+0x1c539] # <unfortunate> mov ebx,0xd mov eax,ebx pop rbx ret # -Cpanic=abort: push rax call QWORD PTR [rip+0x20a1] # <happy> mov eax,0x2a pop rcx ret ``` Fixes #64224, and resolves #64222.
2020-03-14Rollup merge of #69960 - RalfJung:abort, r=oli-obkYuki Okushi-1/+1
miri engine: fix treatment of abort intrinsic I screwed up in https://github.com/rust-lang/rust/pull/69830 and added `abort` to the wrong block of intrinsics, namely the one that actually has a return place. So that branch was never actually reached. r? @oli-obk
2020-03-13bless testsRalf Jung-1/+1
2020-03-12Move some more tests to `check-pass`LeSeulArtichaut-3/+6
2020-03-12Move some const-eval `build-pass` tests to `check-pass`LeSeulArtichaut-20/+20
2020-03-11make error message less confusingRalf Jung-22/+22
2020-03-11generalize InvalidNullPointerUsage to InvalidIntPointerUsageRalf Jung-3/+3
2020-03-11fmt, tweak messages and blessRalf Jung-26/+26
2020-03-08fix some cases of unexpected exceptions leaving validationRalf Jung-24/+44
2020-03-08fix type size mismatch on 32bitRalf Jung-20/+19
2020-03-06please tidyRalf Jung-13/+14
2020-03-06better error messages for invalid boxes (and a few more tests)Ralf Jung-17/+39