summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval
AgeCommit message (Collapse)AuthorLines
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
2019-08-29Rollup merge of #63880 - RalfJung:miri-meta, r=oli-obkMazdak Farrokhzad-66/+123
Validation: check raw wide pointer metadata While I was at it, I also added a missing check for slices not to be too big. r? @oli-obk Fixes https://github.com/rust-lang/miri/issues/918
2019-08-26adjust testsRalf Jung-18/+9
2019-08-25test for too long slicesRalf Jung-7/+17
2019-08-25validate raw wide pointersRalf Jung-66/+122
2019-08-25factor wide ptr metadata checking into separate methodRalf Jung-6/+6
also fat -> wide
2019-08-22Changed testsWesley Wiser-29/+15
2019-08-17fix testsRalf Jung-3/+3
2019-08-14Rollup merge of #63075 - RalfJung:deref-checks, r=oli-obkMazdak Farrokhzad-15/+21
Miri: Check that a ptr is aligned and inbounds already when evaluating `*` This syncs Miri with what the Nomicon and the Reference say, and resolves https://github.com/rust-lang/miri/issues/447. Also this would not have worked without https://github.com/rust-lang/rust/pull/62982 due to new cycles. ;) r? @oli-obk
2019-08-02bless all the thingsRalf Jung-4/+4
2019-08-02add is_any_ptr type test; this also helps pacify tidyRalf Jung-1/+0