about summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval
AgeCommit message (Collapse)AuthorLines
2019-11-18Remove E0308 note when primary label has all infoEsteban Küber-4/+0
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-2/+2
2019-11-15Add explanation of test for validation mismatchDylan MacKenzie-7/+15
2019-11-15Rollup merge of #66306 - spastorino:remove-error-handled-by-miri, r=oli-obkYuki Okushi-3/+5
Remove cannot mutate statics in initializer of another static error r? @oli-obk This is just a refactoring. As the removed code itself said, it only a heuristic catching a few cases early instead of leaving it all to const eval. It's easy to work around the static check and then run into the miri-engine check.
2019-11-13Bless less verbose error messagesDylan MacKenzie-72/+16
The MIR const-checker errors for if/match/loop are now delay span bugs, so nothing will be emitted unless the HIR checker misses something.
2019-11-13Bless back-compat breakagesDylan MacKenzie-7/+31
This PR BREAKS CODE THAT WAS ACCEPTED ON STABLE. It's arguably a bug that this was accepted in the first place, but here we are. See #62272 for more info.
2019-11-13Bless const tests with improved diagnosticsDylan MacKenzie-11/+59
2019-11-12check-consts remove cannot mutate statics in initializer of another static errorSantiago Pastorino-3/+5
2019-11-10Make error and warning annotations mandatory in UI testsTomasz Miąsko-22/+6
This change makes error and warning annotations mandatory in UI tests. The only exception are tests that use error patterns to match compiler output and don't have any annotations.
2019-11-06--blessRalf Jung-2/+2
2019-10-27Implementation of const caller_location.Adam Perry-0/+23
2019-10-20Remove `borrowck_graphviz_postflow` from testDylan MacKenzie-6/+3
2019-10-19Auto merge of #64890 - wesleywiser:const_prop_rvalue, r=oli-obkbors-0/+28
[const-prop] Handle remaining MIR Rvalue cases r? @oli-obk
2019-10-18Don't ICE when evaluating writes to uninhabited enum variantsWesley Wiser-0/+28
2019-10-16Add regression test for #65394Dylan MacKenzie-0/+24
2019-10-04[const-prop] Fix ICE when trying to eval polymorphic promoted MIRWesley Wiser-11/+22
2019-10-02Rollup merge of #64991 - wesleywiser:fix_too_eager_const_prop, r=oli-obkMazdak Farrokhzad-0/+23
[const-prop] Correctly handle locals that can't be propagated `const_prop()` now handles writing the Rvalue into the Place in the stack frame for us. So if we're not supposed to propagate that value, we need to clear it. r? @oli-obk Fixes #64970
2019-10-02[const-prop] Correctly handle locals that can't be propagatedWesley Wiser-0/+23
`const_prop()` now handles writing the Rvalue into the Place in the stack frame for us. So if we're not supported to propagate that value, we need to clear it.
2019-10-01Add test cases for #64945Dylan MacKenzie-0/+61
This also tests that `&&[]` no longer causes an ICE in this PR (although the test fails the borrow checker). This could be more complete.
2019-09-30Rollup merge of #64377 - GuillaumeGomez:E0493, r=estebankTyler Mandry-0/+1
Add long error explanation for E0493 Part of #61137.
2019-09-30update testsGuillaume Gomez-0/+1
2019-09-29Auto merge of #64470 - ecstatic-morse:split-promotion-and-validation, ↵bors-188/+21
r=eddyb,oli-obk Implement dataflow-based const validation This PR adds a separate, dataflow-enabled pass that checks the bodies of `const`s, `static`s and `const fn`s for [const safety](https://github.com/rust-rfcs/const-eval/blob/master/const.md). This is based on my work in #63860, which tried to integrate into the existing pass in [`qualify_consts.rs`](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/qualify_consts.rs). However, the resulting pass was even more unwieldy than the original. Unlike its predecessor, this PR is designed to be combined with #63812 to replace the existing pass completely. The new checker lives in [`librustc_mir/transform/check_consts`](https://github.com/ecstatic-morse/rust/tree/split-promotion-and-validation/src/librustc_mir/transform/check_consts). [`qualifs.rs`](https://github.com/ecstatic-morse/rust/blob/split-promotion-and-validation/src/librustc_mir/transform/check_consts/qualifs.rs) contains small modifications to the existing `Qualif` trait and its implementors, but is mostly unchanged except for the removal of `IsNotPromotable` and `IsNotImplicitlyPromotable`, which are only necessary for promotion. [`resolver.rs`](https://github.com/ecstatic-morse/rust/blob/split-promotion-and-validation/src/librustc_mir/transform/check_consts/resolver.rs) contains the dataflow analysis used to propagate qualifs between locals. Finally, [`validation.rs`](https://github.com/ecstatic-morse/rust/blob/split-promotion-and-validation/src/librustc_mir/transform/check_consts/validation.rs) contains a refactored version of the existing [`Visitor`](https://github.com/rust-lang/rust/blob/ca3766e2e58f462a20922e42c821a37eaf0e13db/src/librustc_mir/transform/qualify_consts.rs#L1024) in `qualfy_consts.rs`. All errors have been associated with a `struct` to make [comparison with the existing pass](https://github.com/ecstatic-morse/rust/blob/1c19f2d540ca0a964900449d79a5d5181b43146d/src/librustc_mir/transform/qualify_consts.rs#L1006) simple. The existing validation logic in [`qualify_consts`](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/qualify_consts.rs) has been modified to allow it to run in parallel with the new validator. If [`use_new_validator`](https://github.com/rust-lang/rust/pull/64470/files#diff-c2552a106550d05b69d5e07612f0f812R950) is not set, the old validation will be responsible for actually generating the errors, but those errors can be compared with the ones from the new validator.
2019-09-28Fix tests broken by more consistent miri unleashed warningsDylan MacKenzie-188/+21
2019-09-27[const-prop] Replace `eval_place()` with use of `InterpCx`Wesley Wiser-2/+11
2019-09-25Rollup merge of #64738 - gnzlbg:miri_norm_abi, r=oli-obkMazdak Farrokhzad-0/+53
Add const-eval support for SIMD types, insert, and extract This adds initial support for constant-evaluation of Abi::Vector types. r? @oli-obk
2019-09-25Remove fail testsgnzlbg-201/+0
2019-09-25Clean testsgnzlbg-11/+31
2019-09-25Test errorsgnzlbg-60/+181
2019-09-25Refactorgnzlbg-0/+24
2019-09-25Allow simd_insert and simd_extract in const_fngnzlbg-290/+2
2019-09-24Add some more testsgnzlbg-27/+296
2019-09-24Move tests to SIMD subdirectorygnzlbg-8/+8
2019-09-24Add a fail testgnzlbg-0/+36
2019-09-24Add const-eval support for SIMD types, insert, and extractgnzlbg-0/+72
2019-09-24Stabilize `str::len`, `[T]::len`, `is_empty` and `str::as_bytes` as const fnOliver Scherer-2/+10
2019-09-21remove featuregnzlbg-84/+255
2019-09-20Allow using fn pointers in const fn behind const_fn_ptr gategnzlbg-0/+128
2019-09-08Update test stderr with results of enabling unused lintsMark Rousskov-0/+1
2019-09-06Fixed grammar/style in error messages and reblessed tests.Alexander Regueiro-59/+59
2019-09-02Fix tests againYuki Okushi-22/+105
2019-09-02Fix condition and tests' flagsYuki Okushi-15/+22
2019-09-02Fix overflow_checkYuki Okushi-12/+19
2019-09-02Add `opt-level` checkYuki Okushi-19/+12
2019-08-30Rollup merge of #64015 - RalfJung:const-tests, r=oli-obkMazdak Farrokhzad-60/+84
some const-eval test tweaks Best reviewed commit-by-commit. r? @oli-obk
2019-08-30add testRalf Jung-0/+29
2019-08-30const-eval tests: make all unions repr(C)Ralf Jung-59/+79
2019-08-30explain why REF_AS_USIZE is importantRalf Jung-0/+3
2019-08-30tweak const-valid testRalf Jung-1/+2
2019-08-30make unions repr(C)Ralf Jung-18/+21
2019-08-30better variable namesRalf Jung-28/+28