summary refs log tree commit diff
path: root/src/test/ui/consts
AgeCommit message (Collapse)AuthorLines
2019-04-07bless the ui testsPietro Albini-3/+3
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-03-16Don'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
2019-01-22Auto merge of #56221 - estebank:remove-dummy-checks, r=varkorbors-2/+2
Remove unnecessary dummy span checks The emitter already verifies wether a given span note or span label can be emitted to the output. If it can't, because it is a dummy span, it will be either elided for labels or emitted as an unspanned note/help when applicable.
2019-01-21fix validation range printing when encountering undefRalf Jung-3/+18
2019-01-21Declare some unconst operations as unsafe in const fnOliver Scherer-54/+82
2019-01-20Remove unnecessary dummy span checksEsteban Küber-2/+2
The emitter already verifies wether a given span note or span label can be emitted to the output. If it can't, because it is a dummy span, it will be either elided for labels or emitted as an unspanned note/help when applicable.
2019-01-18Allow evaluating trivial drop glue in constantsOliver Scherer-0/+13
2019-01-12Rollup merge of #57175 - oli-obk:const_let_stabilization, r=nikomatsakisMazdak Farrokhzad-360/+152
Stabilize `let` bindings and destructuring in constants and const fn r? @Centril This PR stabilizes the following features in constants and `const` functions: * irrefutable destructuring patterns (e.g. `const fn foo((x, y): (u8, u8)) { ... }`) * `let` bindings (e.g. `let x = 1;`) * mutable `let` bindings (e.g. `let mut x = 1;`) * assignment (e.g. `x = y`) and assignment operator (e.g. `x += y`) expressions, even where the assignment target is a projection (e.g. a struct field or index operation like `x[3] = 42`) * expression statements (e.g. `3;`) This PR does explicitly *not* stabilize: * mutable references (i.e. `&mut T`) * dereferencing mutable references * refutable patterns (e.g. `Some(x)`) * operations on `UnsafeCell` types (as that would need raw pointers and mutable references and such, not because it is explicitly forbidden. We can't explicitly forbid it as such values are OK as long as they aren't mutated.) * We are not stabilizing `let` bindings in constants that use `&&` and `||` short circuiting operations. These are treated as `&` and `|` inside `const` and `static` items right now. If we stopped treating them as `&` and `|` after stabilizing `let` bindings, we'd break code like `let mut x = false; false && { x = true; false };`. So to use `let` bindings in constants you need to change `&&` and `||` to `&` and `|` respectively.
2019-01-12const_let: --bless with --compare-mode=nllMazdak Farrokhzad-10/+19
2019-01-12Auto merge of #57234 - Centril:const-stabilizations-2, r=oli-obkbors-15/+428
Const-stabilize `const_int_ops` + `const_ip` r? @oli-obk ## Note for relnotes: This PR includes https://github.com/rust-lang/rust/pull/57105. I've added T-lang since this affects intrinsics and the operational semantics of Rust's `const fn` fragment. ## Stable APIs proposed for constification + `const_int_ops`: + `count_ones` + `count_zeros` + `leading_zeros` + `trailing_zeros` + `swap_bytes` + `from_be` + `from_le` + `to_be` + `to_le` + `const_ip` + `Ipv4Addr::new` ## Unstable APIs constified + `const_int_conversion`: + `reverse_bits`
2019-01-09Fix irrefutable slice patterns in const fnOliver Scherer-0/+25
2019-01-09const fn feature gate is not needed anymore in a lot of testsOliver Scherer-12/+13
2019-01-09Stabilize `let` bindings and destructuring in constants and const fnOliver Scherer-347/+104
2019-01-05Rollup merge of #57249 - frewsxcv:frewsxcv-second-edition, r=KodrAuskennytm-4/+4
Fix broken links to second edition TRPL. Fixes https://github.com/rust-lang/rust/issues/57104. Remove `second-edition/` from TRPL hyperlinks.
2019-01-01Fix broken links to second edition TRPL.Corey Farwell-4/+4
Fixes https://github.com/rust-lang/rust/issues/57104.
2018-12-31Improve type mismatch error messagesYuning Zhang-16/+16
Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing.
2018-12-31unchecked_{shl,shr}: extend const tests.Mazdak Farrokhzad-15/+428
2018-12-28Update src/test/ui/consts/const-nonzero.rsOliver Scherer-1/+1
Co-Authored-By: Dylan-DPC <dylan.dpc@gmail.com>
2018-12-28Make the getter for NonZero types into a const fndylan_DPC-0/+9
2018-12-27Set a `def_id` in `ParamEnv` only with `-Z chalk`scalexm-1/+1
2018-12-25Remove licensesMark Rousskov-1639/+429
2018-12-23Rollup merge of #57067 - Centril:stabilize-min_const_unsafe_fn, r=oli-obkMazdak Farrokhzad-146/+75
Stabilize min_const_unsafe_fn in 1.33 Fixes #55607 r? @oli-obk
2018-12-23Rollup merge of #56916 - oli-obk:static_mut_beta_regression, r=davidtwcoMazdak Farrokhzad-0/+49
Fix mutable references in `static mut` fixes #56903
2018-12-23stabilize min_const_unsafe_fn -- revert const-size_of-cycle changesMazdak Farrokhzad-0/+4
2018-12-23stabilize min_const_unsafe_fn --bless tests.Mazdak Farrokhzad-16/+12
2018-12-23stabilize min_const_unsafe_fn in 1.33.Mazdak Farrokhzad-139/+68
2018-12-23Rollup merge of #57039 - davidtwco:migrate-warning-wording, r=pnkfelixkennytm-6/+4
Update migrate warning wording. This PR modifies the wording of the warning for backwards-incompatible changes in migrate mode. The warning messages are changed to be lowercase and not include line-breaks in order to be consistent with other compiler diagnostics.
2018-12-23Rollup merge of #56919 - oli-obk:null_ref_array_tuple, r=RalfJungkennytm-0/+9
Remove a wrong multiplier on relocation offset computation r? @RalfJung fixes #56800
2018-12-22Update migrate warning wording.David Wood-6/+4
This commit modifies the wording of the warning for backwards-incompatible changes in migrate mode. The warning messages are changed to be lowercase and not include line-breaks in order to be consistent with other compiler diagnostics.
2018-12-21Update tests to changes on masterOliver Scherer-2/+10
2018-12-21Also test projectionsOliver Scherer-1/+18