about summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval
AgeCommit message (Collapse)AuthorLines
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
2019-08-02improve error when CTFE does ptr-int-cast; update testsRalf Jung-20/+25
2019-07-28fix testsRalf Jung-15/+21
2019-07-17normalize use of backticks in compiler messages for librustc/lintSamy Kacimi-10/+10
https://github.com/rust-lang/rust/issues/60532
2019-07-14miri validation: better error messages for dangling referencesRalf Jung-3/+3
2019-07-11rustc_mir: follow FalseUnwind's real_target edge in qualify_consts.Eduard-Mihai Burtescu-13/+46
2019-07-10Rollup merge of #62275 - eddyb:const-drop-replace, r=pnkfelixMazdak Farrokhzad-10/+32
rustc_mir: treat DropAndReplace as Drop + Assign in qualify_consts. This slipped through the cracks and never got implemented (thankfully that just meant it was overly conservative and didn't allow assignments that don't *actually* drop the previous value). Fixes #62273. r? @oli-obk
2019-07-09normalize use of backticks in compiler messages for libsyntax/feature_gateSamy Kacimi-5/+5
https://github.com/rust-lang/rust/issues/60532
2019-07-04improve validity error range printing for singleton rangesRalf Jung-2/+2
2019-07-04turns out that dangling pointer branch is dead code; remove it and improve ↵Ralf Jung-37/+88
the error that actually gets shown a bit
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-21/+21
2019-07-02rustc_mir: treat DropAndReplace as Drop + Assign in qualify_consts.Eduard-Mihai Burtescu-10/+32
2019-06-29Rollup merge of #61755 - Centril:compiletest-force-check, r=petrochenkovMazdak Farrokhzad-30/+36
Add `--pass $mode` to compiletest through `./x.py` Adds a flag `--pass $mode` to compiletest, which is exposed through `./x.py`. When `--pass $mode` is passed, `{check,build,compile,run}-pass` tests will be forced to run under the given `$mode` unless the directive `// ignore-pass` exists in the test file. The modes are explained in https://github.com/rust-lang/rust/pull/61778: - `check` has the same effect as `cargo check` - `build` or `compile` have the same effect as `cargo build` - `run` has the same effect as `cargo run` On my machine, `./x.py -i test src/test/run-pass --stage 1 --pass check` takes 38 seconds whereas it takes 2 min 7 seconds without `--pass check`. cc https://github.com/rust-lang/rust/issues/61712 r? @petrochenkov
2019-06-24Auto merge of #62081 - RalfJung:miri-pointer-checks, r=oli-obkbors-3/+3
Refactor miri pointer checks Centralize bounds, alignment and NULL checking for memory accesses in one function: `memory.check_ptr_access`. That function also takes care of converting a `Scalar` to a `Pointer`, should that be needed. Not all accesses need that though: if the access has size 0, `None` is returned. Everyone accessing memory based on a `Scalar` should use this method to get the `Pointer` they need. All operations on the `Allocation` work on `Pointer` inputs and expect all the checks to have happened (and will ICE if the bounds are violated). The operations on `Memory` work on `Scalar` inputs and do the checks themselves. The only other public method to check pointers is `memory.ptr_may_be_null`, which is needed in a few places. No need for `check_align` or similar methods. That makes the public API surface much easier to use and harder to mis-use. This should be largely no-functional-change, except that ZST accesses to a "true" pointer that is dangling or out-of-bounds are now considered UB. This is to be conservative wrt. whatever LLVM might be doing. While I am at it, this also removes the assumption that the vtable part of a `dyn Trait`-fat-pointer is a `Pointer` (as opposed to a pointer cast to an integer, stored as raw bits). r? @oli-obk
2019-06-24promoted_errors: warn -> deny.Mazdak Farrokhzad-30/+36
2019-06-23Auto merge of #61778 - petrochenkov:pass, r=Mark-Simulacrumbors-2/+0
compiletest: Introduce `// {check,build,run}-pass` pass modes Pass UI tests now have three modes ``` // check-pass // build-pass // run-pass ``` mirroring equivalent well-known `cargo` commands. `// check-pass` will compile the test skipping codegen (which is expensive and isn't supposed to fail in most cases). `// build-pass` will compile and link the test without running it. `// run-pass` will compile, link and run the test. Tests without a "pass" annotation are still considered "fail" tests. Most UI tests would probably want to switch to `check-pass`. Tests validating codegen would probably want to run the generated code as well and use `run-pass`. `build-pass` should probably be rare (linking tests?). https://github.com/rust-lang/rust/pull/61755 will provide a way to run the tests with any mode, e.g. bump `check-pass` tests to `run-pass` to satisfy especially suspicious people, and be able to make sure that codegen doesn't breaks in some entirely unexpected way. Tests marked with any mode are expected to pass with any other mode, if that's not the case for some legitimate reason, then the test should be made a "fail" test rather than a "pass" test. Perhaps some secondary CI can verify this invariant, but that's not super urgent. `// compile-pass` still works and is equivalent to `build-pass`. Why is `// compile-pass` bad - 1) it gives an impression that the test is only compiled, but not linked, 2) it doesn't mirror a cargo command. It can be removed some time in the future in a separate PR. cc https://github.com/rust-lang/rust/issues/61712
2019-06-23comment tweaks, better validation errors, update UI testsRalf Jung-3/+3
2019-06-17Make use of `ptr::null(_mut)` instead of casting zeroLzu Tao-1/+1
2019-06-16compiletest: Validate pass modes harderVadim Petrochenkov-2/+0
2019-06-13Create fewer basic blocks in match MIR loweringMatthew Jasper-3/+10
2019-06-06Bless test outputWesley Wiser-0/+12
2019-05-29Update ui test suite to use dynmemoryruins-17/+17
2019-05-12Remove feature(nll) when compare mode is sufficientMatthew Jasper-2/+0
2019-05-07compiletest: only use `make_exe_name` for tests that end up being executed.Eduard-Mihai Burtescu-2/+0
2019-04-22Update ui testsvarkor-2/+2
2019-04-22Remove double trailing newlinesvarkor-7/+0
2019-04-22update tests for migrate mode by defaultMatthew Jasper-260/+93
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-7/+7
2019-04-11Reword tracking issue noteEsteban Küber-6/+6
2019-04-10Tweak unstable diagnostic outputEsteban Küber-8/+15
2019-03-23Deduplicate const eval error spans for better outputEsteban Küber-6/+2
2019-03-23Swap const evaluation lint spans to point at problem in primary spanEsteban Küber-182/+210
2019-03-11Update NLL testsVadim Petrochenkov-14/+14
2019-03-11Update testsVadim Petrochenkov-71/+71
2019-02-23Rollup merge of #58658 - pmccarter:align_msg, r=matthewjasperMazdak Farrokhzad-6/+8
Add expected/provided byte alignments to validation error message Fixes #58617
2019-02-22#58658 bless after line split for tidyPatrick McCarter-5/+5
2019-02-22tidy line length override #58617Patrick McCarter-0/+1
2019-02-22Change byte align message wording #58617Patrick McCarter-2/+2
2019-02-22Invalid byte alignment expected/provided in message #58617Patrick McCarter-5/+6
2019-02-22Switch from error patterns to `//~ ERROR` markers.Felix S. Klock II-8/+11
AFAICT, we do not have the same const-eval issues that we used to when rust-lang/rust#23926 was filed. (Probably because of the switch to miri for const-evaluation.)
2019-01-22Rollup merge of #57813 - RalfJung:validation-range-printing, r=oli-obkMazdak Farrokhzad-3/+18
fix validation range printing when encountering undef