summary refs log tree commit diff
path: root/src/test/ui/consts
AgeCommit message (Collapse)AuthorLines
2020-05-09normalize field projection ty to fix broken MIR issueSantiago Pastorino-0/+1
2020-04-22adjust testsRalf Jung-4/+2
2020-04-19Rollup merge of #71324 - petrochenkov:passcheck2, r=RalfJungDylan DPC-2/+2
Fix some tests failing in `--pass check` mode r? @RalfJung
2020-04-19Rollup merge of #71317 - RalfJung:unleash-inline-asm, r=ecstatic-morseDylan DPC-0/+25
miri-unleash test for llvm_asm r? @oli-obk @ecstatic-morse
2020-04-19Fix commentRalf Jung-3/+2
2020-04-19Fix some tests failing in `--pass check` modeVadim Petrochenkov-2/+2
2020-04-19miri-unleash test for llvm_asmRalf Jung-0/+26
2020-04-18miri-unleashed: test that we detect heap allocationsRalf Jung-0/+29
2020-04-17Auto merge of #71049 - eddyb:const-err, r=oli-obkbors-148/+25
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-17Rollup merge of #71206 - RalfJung:dont-try, r=oli-obkDylan DPC-1/+1
Miri error messages: avoid try terminology r? @oli-obk
2020-04-16bikeshedRalf Jung-1/+1
2020-04-16ty: convert `ErrorHandled::Reported` to `ConstKind::Error`.Eduard-Mihai Burtescu-148/+25
2020-04-16Miri error messages: avoid try terminologyRalf Jung-1/+1
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: always expose repeat count `AnonConst`s' parent in `generics_of`.Eduard-Mihai Burtescu-45/+8
2020-04-14borrow_check/type_check: normalize `Aggregate` and `Call` operands.Eduard-Mihai Burtescu-0/+15
2020-04-14typeck: workaround WF hole in `to_const`.Eduard-Mihai Burtescu-5/+30
2020-04-12fix issue 69130David Renshaw-1/+1
2020-04-11rustc: Add a warning count upon completionRoccoDev-20/+44
2020-04-08Small tweaks to required bound spanEsteban Küber-2/+2
2020-04-08Use `PredicateObligation`s instead of `Predicate`sEsteban Küber-2/+2
Keep more information about trait binding failures.
2020-04-05add testRalf Jung-0/+14
2020-04-05add testRalf Jung-0/+10
2020-04-03Rollup merge of #70696 - jumbatm:extend-issue-69020-test, r=RalfJungDylan DPC-119/+0
Extend #69020 test to include reversed operand order. Make sure we still emit if a lint if the generic argument comes first. See https://github.com/rust-lang/rust/pull/70566#issuecomment-607671340. r? @RalfJung
2020-04-02Move #69020 test to ui/associated-const + rebless.jumbatm-137/+0
2020-04-02Extend #69020 test to include reversed order.jumbatm-0/+18
Make sure we check the case where the generic operand comes first, in case any future changes make this ordering matter.
2020-04-02tests: remove ignore directives from tests that mention core/alloc/std spans.Eduard-Mihai Burtescu-30/+17
2020-04-01Rollup merge of #70590 - RalfJung:miri-backtrace, r=oli-obkDylan DPC-74/+148
Miri: make backtrace function names and spans match up Currently, Miri backtraces are a bit confusing: ``` error: Undefined Behavior: entering unreachable code --> tests/compile-fail/never_transmute_void.rs:10:11 | 10 | match v {} //~ ERROR entering unreachable code | ^ entering unreachable code | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information note: inside call to `f` at tests/compile-fail/never_transmute_void.rs:17:5 --> tests/compile-fail/never_transmute_void.rs:17:5 | 17 | f(v); //~ inside call to `f` | ^^^^ = note: inside call to `main` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/rt.rs:67:34 = note: inside call to closure at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/rt.rs:52:73 = note: inside call to closure at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/sys_common/backtrace.rs:130:5 ``` When reading this like a normal backtrace, one would expect that e.g. the backrace involves the "main" function at "libstd/rt.rs:67:34". But that is not actually where we are in the main function, that is *where the main function is called*. This is not how backtraces are usually rendered (including e.g. with `RUST_BACKTRACE=1`). Usually we print next to each function name where inside that function the frame is currently executing, not where the *parent* frame is executing. With this PR and the Miri side at https://github.com/rust-lang/miri/pull/1283, the backtrace now looks as follows: ``` error: Undefined Behavior: entering unreachable code --> tests/compile-fail/never_transmute_void.rs:10:11 | 10 | match v {} //~ ERROR entering unreachable code | ^ entering unreachable code | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: inside `f` at tests/compile-fail/never_transmute_void.rs:10:11 note: inside `main` at tests/compile-fail/never_transmute_void.rs:17:5 --> tests/compile-fail/never_transmute_void.rs:17:5 | 17 | f(v); //~ inside `main` | ^^^^ = note: inside closure at /home/r/src/rust/rustc/src/libstd/rt.rs:67:34 = note: inside closure at /home/r/src/rust/rustc/src/libstd/rt.rs:52:73 = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1:6034 ~ std[87db]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc/src/libstd/sys_common/backtrace.rs:130:5 ``` Now function name and printed line numbers match up in the notes. This code is partially shared with const-eval, so the change also affects const-eval: instead of printing what is being called at some span, we print which function/constant this span is inside. With this, we can also remove the `span` field from Miri's stack frames (which used to track the *caller span* of that frame, quite confusing), and then get of a whole lot of `span` arguments that ultimately just served to fill that field (and as a fallback for `caller_location`, which however was never actually used). r? @oli-obk
2020-04-01Rollup merge of #70081 - lcnr:issue68387, r=varkorDylan DPC-1/+1
add `unused_braces` lint Add the lint `unused_braces` which is warn by default. `unused_parens` is also extended and now checks anon consts. closes #68387 r? @varkor
2020-03-31update testsBastian Kauschke-1/+1
2020-03-31const backtrace: do not skip first frameRalf Jung-1/+12
2020-03-30bless testsRalf Jung-73/+136
2020-03-27non-exhastive diagnostic: add note re. scrutinee typeMazdak Farrokhzad-0/+15
2020-03-25Rollup merge of #70319 - lcnr:issue63695, r=eddybDylan DPC-1/+1
correctly normalize constants closes #70317 implements https://github.com/rust-lang/rust/issues/70125#issuecomment-602133708 r? eddyb cc @varkor
2020-03-24improve normalize cycle errorBastian Kauschke-1/+1
2020-03-24get back the more precise error messageRalf Jung-1/+1
2020-03-24bless; add test for mutating a staticRalf Jung-4/+48
2020-03-24Rollup merge of #70087 - ecstatic-morse:remove-const-eval-loop-detector, ↵Mazdak Farrokhzad-70/+46
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-23Remove leftover mentions of `from_anon_const`Oliver Scherer-1/+1
2020-03-23Evaluate repeat expression lengths as late as possibleOliver Scherer-39/+67
2020-03-22Rename `TimeLimitReached` -> `StepLimitReached`Dylan MacKenzie-3/+3
2020-03-21Rollup merge of #70126 - wesleywiser:fix_miri_ice_neg_zst_enum_discr, ↵Dylan DPC-0/+47
r=RalfJung,eddyb Fix ICE caused by truncating a negative ZST enum discriminant Fixes #70114 r? @oli-obk or @RalfJung
2020-03-21Fix ICE caused by truncating a negative ZST enum discriminantWesley Wiser-0/+47
2020-03-21Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJungMazdak Farrokhzad-0/+22
Remove the call that makes miri fail Fixes the concern raised in https://github.com/rust-lang/rust/pull/69645/files#r392884274 cc @RalfJung
2020-03-20Update const_forget.rsDutchGhost-1/+1
2020-03-18Move the const-forget test into ui testsDutchGhost-0/+22
2020-03-18Rollup merge of #69839 - RalfJung:miri-error-cleanup, r=oli-obkMazdak Farrokhzad-80/+80
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-70/+46