about summary refs log tree commit diff
path: root/src/test/ui/consts
AgeCommit message (Collapse)AuthorLines
2019-04-23Stabilize futures_apiTaylor Cramer-1/+2
2019-04-23Add rustc_allow_const_fn_ptrTaylor Cramer-0/+62
2019-04-23Rollup merge of #60169 - varkor:tidy-unnecessary-ignore-newline, r=kennytmMazdak Farrokhzad-3/+1
Warn when ignore-tidy-linelength is present, but no lines are too long It's easy for a `// ignore-tidy-linelength` to be added when there is a genuine need to ignore a file's line length, but then after refactoring the need is gone, but the tidy directive is not removed. This means that in the future, further editing may accidentally add unnecessarily long lines. This change forces `// ignore-tidy-linelength` to be used exactly when necessary, to make sure such changes are intentional.
2019-04-23Update ui testsvarkor-1/+1
2019-04-23Remove unnecessary ignore-tidy-linelengthvarkor-2/+0
2019-04-23Auto merge of #60125 - estebank:continue-evaluating, r=oli-obkbors-69/+176
Don't stop evaluating due to errors before borrow checking r? @oli-obk Fix #60005. Follow up to #59903. Blocked on #53708, fixing the ICE in `src/test/ui/consts/match_ice.rs`.
2019-04-22Fix ICE related to #53708Esteban Küber-13/+21
2019-04-22Never stop due to errors before borrow checkingEsteban Küber-65/+164
2019-04-22Update ui testsvarkor-2/+2
2019-04-22Remove double trailing newlinesvarkor-9/+0
2019-04-22update tests for migrate mode by defaultMatthew Jasper-1152/+349
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-23/+21
2019-04-17Rollup merge of #59646 - JohnTitor:improve-wording, r=oli-obkMazdak Farrokhzad-18/+19
const fn: Improve wording fixes #59611 This might need discussion. Feel free to close this PR if we don't need to fix.
2019-04-16Fix testsYuki OKUSHI-18/+19
2019-04-11Reword tracking issue noteEsteban Küber-12/+12
2019-04-10Tweak unstable diagnostic outputEsteban Küber-14/+27
2019-04-07Only run SIMD tests on x86Oliver Scherer-3/+9
2019-04-07Add more regression tests for accidental promotionOliver Scherer-0/+37
2019-04-07Function arguments should never get promotedOliver Scherer-0/+18
2019-04-03Improve wordingYuki OKUSHI-17/+17
2019-03-23Deduplicate const eval error spans for better outputEsteban Küber-28/+12
2019-03-23Swap const evaluation lint spans to point at problem in primary spanEsteban Küber-296/+336
2019-03-16Rollup merge of #59139 - oli-obk:unions_are_a_good_thing, r=RalfJungkennytm-0/+11
Unregress using scalar unions in constants. fixes https://github.com/rust-lang/rust/issues/59126 r? @RalfJung I also made a bunch of these invariants panic instead of report an error.
2019-03-15rustc: provide DisambiguatedDefPathData in ty::print.Eduard-Mihai Burtescu-4/+4
2019-03-15rustc: pass Option<&Substs> and Namespace around in ty::item_path.Eduard-Mihai Burtescu-1/+1
2019-03-12Unregress using scalar unions in constants.Oliver Scherer-0/+11
2019-03-11Update NLL testsVadim Petrochenkov-51/+51
2019-03-11Update testsVadim Petrochenkov-163/+163
2019-03-11Auto merge of #58784 - oli-obk:accidental_promotion, r=eddybbors-0/+18
Don't promote function calls to nonpromotable things fixes https://github.com/rust-lang/rust/issues/58767 and fixes https://github.com/rust-lang/rust/issues/58634 r? @eddyb should we additionally check the function call return type? It might be a promotable function (or any `const fn` inside a `const fn`), but its return type might contain interior mutability.
2019-03-09Rollup merge of #58750 - TimDiekmann:master, r=oli-obkMazdak Farrokhzad-0/+99
Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` const
2019-03-03Add .nll.stderr outputTim-0/+39
2019-03-02Point at enum definition when match patterns are not exhaustiveEsteban Küber-0/+2
``` error[E0004]: non-exhaustive patterns: type `X` is non-empty --> file.rs:9:11 | 1 | / enum X { 2 | | A, | | - variant not covered 3 | | B, | | - variant not covered 4 | | C, | | - variant not covered 5 | | } | |_- `X` defined here ... 9 | match x { | ^ | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms error[E0004]: non-exhaustive patterns: `B` and `C` not covered --> file.rs:11:11 | 1 | / enum X { 2 | | A, 3 | | B, 4 | | C, | | - not covered 5 | | } | |_- `X` defined here ... 11 | match x { | ^ patterns `C` not covered ``` When a match expression doesn't have patterns covering every variant, point at the enum's definition span. On a best effort basis, point at the variant(s) that are missing. This does not handle the case when the missing pattern is due to a field's enum variants: ``` enum E1 { A, B, C, } enum E2 { A(E1), B, } fn foo() { match E2::A(E1::A) { E2::A(E1::B) => {} E2::B => {} } //~^ ERROR `E2::A(E1::A)` and `E2::A(E1::C)` not handled } ``` Unify look between match with no arms and match with some missing patterns. Fix #37518.
2019-02-28Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` constTim-0/+60
Make `Unique::as_ptr` const without feature attribute as it's unstable Make `NonNull::dangling` and `NonNull::cast` const with `feature = "const_ptr_nonnull"`
2019-02-27Don't promote function calls to nonpromotable thingsOliver Scherer-0/+18
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-02-17Rollup merge of #58479 - saleemjaffer:test_promote_evaluation_unused_result, ↵kennytm-0/+8
r=oli-obk compile-pass test for #53606 fixes #53606
2019-02-15compile-pass test for #53606Saleem Jaffer-0/+8
2019-02-14Add updated NLL testsvarkor-37/+108
2019-02-14Update const fn testsvarkor-61/+190
2019-01-31Add a forever unstable opt-out of const qualification checksOliver Scherer-0/+126
2019-01-25Rollup merge of #57734 - oli-obk:fixes_and_cleanups, r=pnkfelixMazdak Farrokhzad-0/+13
Fix evaluating trivial drop glue in constants ```rust struct A; impl Drop for A { fn drop(&mut self) {} } const FOO: Option<A> = None; const BAR: () = (FOO, ()).1; ``` was erroring with ``` error: any use of this value will cause an error --> src/lib.rs:9:1 | 9 | const BAR: () = (FOO, ()).1; | ^^^^^^^^^^^^^^^^^^^^^^^^^^-^ | | | calling non-const function `std::ptr::real_drop_in_place::<(std::option::Option<A>, ())> - shim(Some((std::option::Option<A>, ())))` | = note: #[deny(const_err)] on by default error: aborting due to previous error ``` before this PR. According to godbolt this last compiled successfully in 1.27
2019-01-22Add regression testOliver Scherer-3/+11
2019-01-22Get rid of the fake stack frameOliver Scherer-0/+11
2019-01-22Auto merge of #57830 - Centril:rollup, r=Centrilbors-3/+18
Rollup of 9 pull requests Successful merges: - #57537 (Small perf improvement for fmt) - #57552 (Default images) - #57604 (Make `str` indexing generic on `SliceIndex`.) - #57667 (Fix memory leak in P::filter_map) - #57677 (const_eval: Predetermine the layout of all locals when pushing a stack frame) - #57791 (Add regression test for #54582) - #57798 (Corrected spelling inconsistency) - #57809 (Add powerpc64-unknown-freebsd) - #57813 (fix validation range printing when encountering undef) Failed merges: r? @ghost
2019-01-22Rollup merge of #57813 - RalfJung:validation-range-printing, r=oli-obkMazdak Farrokhzad-3/+18
fix validation range printing when encountering undef