about summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval
AgeCommit message (Collapse)AuthorLines
2021-05-07bless 32bitRalf Jung-1/+1
2021-05-07fix null pointer error messagesRalf Jung-1/+1
2021-05-0632bit blessRalf Jung-1/+1
2021-05-06use CheckInAllocMsg::PointerArithmeticTest for ptr_offset errorRalf Jung-1/+1
2021-05-02Change 'NULL' to 'null'Brent Kerby-9/+9
2021-04-29re-bless on 32bitRalf Jung-7/+7
2021-04-29remove const_fn feature gate from const testsRalf Jung-41/+30
2021-04-18move 'trait bounds on const fn' to separate feature gateRalf Jung-1/+1
2021-04-02Auto merge of #76881 - hameerabbasi:issue-53325, r=oli-obkbors-100/+1263
Add allocation information to undefined behaviour errors. So far I'm looking on information on whether the error messages are suitable. Fixes #53325.
2021-04-01Limit the problematic tests to x86_64.Hameer Abbasi-63/+2
2021-03-31Revert testsOli Scherer-11/+8
2021-03-31Add a new normalization query just for mir constantsOli Scherer-10/+13
2021-03-31Add 32bit.stderr files.Hameer Abbasi-0/+969
2021-03-31Rename stderr->64bit.stderr where needed.Hameer Abbasi-102/+115
2021-03-31Add allocation information to undefined behaviour errors.Hameer Abbasi-0/+242
2021-02-16add testRalf Jung-10/+37
2021-02-08Rollup merge of #81779 - geogriff:const-ptr-to-int-error, r=lcnrMara Bos-1/+1
improve error message for disallowed ptr-to-int casts in const eval Improves an error message as [suggested](https://github.com/rust-lang/rust/issues/80875#issuecomment-762754580) in #80875. Does the wording make enough sense? I tried to follow precedent for error message style while maintaining brevity. It seems like the rest of the `ConstEvalErrKind::NeedsRfc` error messages could be improved as well. I could give that a go if this approach works. Closes #80875
2021-02-07Auto merge of #80652 - calebzulawski:simd-lanes, r=nagisabors-3/+7
Improve SIMD type element count validation Resolves rust-lang/stdsimd#53. These changes are motivated by `stdsimd` moving in the direction of const generic vectors, e.g.: ```rust #[repr(simd)] struct SimdF32<const N: usize>([f32; N]); ``` This makes a few changes: * Establishes a maximum SIMD lane count of 2^16 (65536). This value is arbitrary, but attempts to validate lane count before hitting potential errors in the backend. It's not clear what LLVM's maximum lane count is, but cranelift's appears to be much less than `usize::MAX`, at least. * Expands some SIMD intrinsics to support arbitrary lane counts. This resolves the ICE in the linked issue. * Attempts to catch invalid-sized vectors during typeck when possible. Unresolved questions: * Generic-length vectors can't be validated in typeck and are only validated after monomorphization while computing layout. This "works", but the errors simply bail out with no context beyond the name of the type. Should these errors instead return `LayoutError` or otherwise provide context in some way? As it stands, users of `stdsimd` could trivially produce monomorphization errors by making zero-length vectors. cc `@bjorn3`
2021-02-05fix ui tests referencing pointer-to-integer cast error messageJeffrey Griffin-1/+1
2021-02-03Allow/fix non_fmt_panic in tests.Mara Bos-20/+21
2021-02-03make const_err a future incompat lintRalf Jung-117/+431
2021-02-01Auto merge of #80851 - m-ou-se:panic-2021, r=petrochenkovbors-7/+7
Implement Rust 2021 panic This implements the Rust 2021 versions of `panic!()`. See https://github.com/rust-lang/rust/issues/80162 and https://github.com/rust-lang/rfcs/pull/3007. It does so by replacing `{std, core}::panic!()` by a bulitin macro that expands to either `$crate::panic::panic_2015!(..)` or `$crate::panic::panic_2021!(..)` depending on the edition of the caller. This does not yet make std's panic an alias for core's panic on Rust 2021 as the RFC proposes. That will be a separate change: https://github.com/rust-lang/rust/pull/80879/commits/c5273bdfb266c35e8eab9413aa8d58d27fdbe114 That change is blocked on figuring out what to do with https://github.com/rust-lang/rust/issues/80846 first.
2021-01-29Rollup merge of #81333 - RalfJung:const-err-simplify, r=oli-obkYuki Okushi-39/+25
clean up some const error reporting around promoteds These are some error reporting simplifications enabled by https://github.com/rust-lang/rust/pull/80579. Further simplifications are possible but could be blocked on making `const_err` a hard error. r? ``````@oli-obk``````
2021-01-25Implement new panic!() behaviour for Rust 2021.Mara Bos-7/+7
2021-01-24Rollup merge of #78578 - oli-obk:const_mut_refs, r=RalfJungJonas Schievink-3/+6
Permit mutable references in all const contexts fixes #71212 cc `@rust-lang/wg-const-eval` `@christianpoveda`
2021-01-24clean up some const error reporting around promotedsRalf Jung-39/+25
2021-01-23Fix maximum SIMD lane count, and expose it to other crates. Disallow SIMD ↵Caleb Zulawski-3/+7
vectors with non-power-of-two lengths.
2021-01-23Permit mutable references in all const contextsoli-3/+6
2021-01-22re-bless ui testsRalf Jung-53/+5
2021-01-22avoid promoting division, modulo and indexing operations that could failRalf Jung-199/+158
2021-01-17validation test: turn some const_err back into validation failuresRalf Jung-81/+59
2021-01-13Update tests for extern block lintingMark Rousskov-1/+1
2021-01-04Do not run const prop on the `mir_for_ctfe` of `const fn`oli-1/+1
2021-01-04Keep an unoptimized duplicate of `const fn` aroundoli-31/+59
This allows CTFE to reliably detect UB, as otherwise optimizations may hide UB.
2020-12-02rename MemoryKind::Heap to ConstHeap; bless testVishnunarayan K I-6/+13
2020-12-02add comment and bless some testsVishnunarayan K I-23/+20
2020-12-01review comment and one more testVishnunarayan K I-11/+23
2020-12-01review commentsVishnunarayan K I-1/+43
2020-12-01add const_allocate intrisicVishnunarayan K I-0/+79
2020-11-29Update tests to remove old numeric constantsbstrie-47/+32
Part of #68490. Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros. For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
2020-11-12fix tests and formattingVishnunarayan K I-20/+4
2020-10-22Add test for const panic!(CONST).Mara Bos-17/+45
2020-10-18we can test std and core panic macros togetherRalf Jung-70/+90
2020-10-04But whateverecstatic-morse-0/+1
2020-10-03Ensure that the const-eval engine handles `#[unwind(aborts)]`Dylan MacKenzie-0/+33
2020-09-29Bless outputDylan MacKenzie-1/+1
2020-09-29Bless mut testsDylan MacKenzie-24/+11
2020-09-29Auto merge of #76754 - varkor:diagnostic-cleanup-ii, r=ecstatic-morsebors-57/+57
Clean up diagnostics for arithmetic operation errors Plus a small tweak to a range pattern error message.
2020-09-27Bless testsDylan MacKenzie-1/+23
2020-09-27Update tests with new feature gateDylan MacKenzie-1/+1