about summary refs log tree commit diff
path: root/tests/ui/consts/miri_unleashed
AgeCommit message (Collapse)AuthorLines
2025-09-14Fix typo in error messageJules Bertholet-4/+4
2025-09-03don't uppercase error messagesSasha Pourcelot-16/+16
a more general version of https://github.com/rust-lang/rust/pull/146080. after a bit of hacking in [`fluent.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_fluent_macro/src/fluent.rs), i discovered that i'm not the only one that is bad at following guidelines :sweat_smile:. this pr lowercases the first letter of all the error messages in the codebase. (i did not change things that are traditionally uppercased such as _MIR_, _ABI_ or _C_) i think it's reasonable to run a `@bors try` so all the test suite is checked, as i cannot run some of the tests on my machine. i double checked (and replaced manually) all the old error messages, but better be safe than sorry. in the future i will try to add a check in `x test tidy` that errors if an error message starts with an uppercase letter.
2025-06-26const-eval: allow constants to refer to mutable/external memory, but reject ↵Ralf Jung-71/+55
such constants as patterns
2025-06-07const-eval error: always say in which item the error occurredRalf Jung-20/+20
also adjust the wording a little so that we don't say "the error occurred here" for two different spans
2025-06-04Report the actual item that evaluation failed forOli Scherer-1/+1
2025-06-02Clarify why we are talking about a failed const eval at a random placeOli Scherer-21/+21
2025-06-02Use the informative error as the main const eval error messageOli Scherer-180/+157
2025-05-17Rollup merge of #135808 - tiif:conv_display, r=workingjubileeMatthias Krüger-2/+2
Implement Display for ``rustc_target::callconv::Conv`` Follow up of https://github.com/rust-lang/rust/pull/133103#discussion_r1885552854
2025-05-10Rollup merge of #140151 - RalfJung:drop_in_place-is-not-an-intrinsic, ↵Matthias Krüger-5/+5
r=Mark-Simulacrum remove intrinsics::drop_in_place This was only ever accidentally stable, and has been marked as deprecated since Rust 1.52, released almost 4 years ago. We've removed the old serialization `derive`s, maybe we can remove this one as well? As suggested by ``@jhpratt,`` let's see what crater says for this one.
2025-04-30compiletest: Make diagnostic kind mandatory on line annotationsVadim Petrochenkov-63/+68
2025-04-22remove intrinsics::drop_in_placeRalf Jung-5/+5
2025-04-13UI tests: migrate remaining compile time `error-pattern`s to line annotationsVadim Petrochenkov-3/+4
when possible.
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-2/+2
2025-04-03compiletest: Require `//~` annotations even if `error-pattern` is specifiedVadim Petrochenkov-1/+3
2025-03-25compiletest: Support matching on diagnostics without a spanVadim Petrochenkov-0/+20
2025-03-20Use def_path_str for def id arg in UnsupportedOpInfoMichael Goulet-4/+4
2025-03-12Bless more testtiif-2/+2
2025-02-28Shorten span of panic failures in const contextEsteban Küber-33/+19
Previously, we included a redundant prefix on the panic message and a postfix of the location of the panic. The prefix didn't carry any additional information beyond "something failed", and the location of the panic is redundant with the diagnostic's span, which gets printed out even if its code is not shown. ``` error[E0080]: evaluation of constant value failed --> $DIR/assert-type-intrinsics.rs:11:9 | LL | MaybeUninit::<!>::uninit().assume_init(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation panicked: aborted execution: attempted to instantiate uninhabited type `!` ``` ``` error[E0080]: evaluation of `Fail::<i32>::C` failed --> $DIR/collect-in-dead-closure.rs:9:19 | LL | const C: () = panic!(); | ^^^^^^^^ evaluation panicked: explicit panic | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) ``` ``` error[E0080]: evaluation of constant value failed --> $DIR/uninhabited.rs:41:9 | LL | assert!(false); | ^^^^^^^^^^^^^^ evaluation panicked: assertion failed: false | = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info) ``` --- When the primary span for a const error is the same as the first frame in the const error report, skip it. ``` error[E0080]: evaluation of constant value failed --> $DIR/issue-88434-removal-index-should-be-less.rs:3:24 | LL | const _CONST: &[u8] = &f(&[], |_| {}); | ^^^^^^^^^^^^^^ evaluation panicked: explicit panic | note: inside `f::<{closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:34}>` --> $DIR/issue-88434-removal-index-should-be-less.rs:10:5 | LL | panic!() | ^^^^^^^^ the failure occurred here = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) ``` instead of ``` error[E0080]: evaluation of constant value failed --> $DIR/issue-88434-removal-index-should-be-less.rs:10:5 | LL | panic!() | ^^^^^^^^ explicit panic | note: inside `f::<{closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:34}>` --> $DIR/issue-88434-removal-index-should-be-less.rs:10:5 | LL | panic!() | ^^^^^^^^ note: inside `_CONST` --> $DIR/issue-88434-removal-index-should-be-less.rs:3:24 | LL | const _CONST: &[u8] = &f(&[], |_| {}); | ^^^^^^^^^^^^^^ = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) ``` --- Revert order of constant evaluation errors Point at the code the user wrote first and std functions last. ``` error[E0080]: evaluation of constant value failed --> $DIR/const-errs-dont-conflict-103369.rs:5:25 | LL | impl ConstGenericTrait<{my_fn(1)}> for () {} | ^^^^^^^^ evaluation panicked: Some error occurred | note: called from `my_fn` --> $DIR/const-errs-dont-conflict-103369.rs:10:5 | LL | panic!("Some error occurred"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) ``` instead of ``` error[E0080]: evaluation of constant value failed --> $DIR/const-errs-dont-conflict-103369.rs:10:5 | LL | panic!("Some error occurred"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Some error occurred | note: called from `<() as ConstGenericTrait<{my_fn(1)}>>::{constant#0}` --> $DIR/const-errs-dont-conflict-103369.rs:5:25 | LL | impl ConstGenericTrait<{my_fn(1)}> for () {} | ^^^^^^^^ = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) ```
2024-12-27Remove the `-test` suffix from normalize directivesZalathar-6/+6
2024-12-04Tweak unevaluated constant in pattern errorEsteban Küber-45/+5
Silence errors that are implied by the errors in the `const` item definition. Add a primary span label.
2024-12-04On `const` pattern errors, point at the `const` item definitionEsteban Küber-0/+12
Centralize emitting an error in `const_to_pat` so that all errors from that evaluating a `const` in a pattern can add addditional information. With this, now point at the `const` item's definition: ``` error[E0158]: constant pattern depends on a generic parameter --> $DIR/associated-const-type-parameter-pattern.rs:20:9 | LL | pub trait Foo { | ------------- LL | const X: EFoo; | ------------- constant defined here ... LL | A::X => println!("A::X"), | ^^^^ ```
2024-09-26Stabilize `const_refs_to_static`Ding Xiang Fei-89/+28
update tests fix bitwidth-sensitive stderr output use build-fail for asm tests
2024-09-15stabilize const_mut_refsRalf Jung-26/+1
2024-09-14Auto merge of #129753 - folkertdev:stabilize-const-extern-fn, r=RalfJungbors-6/+4
stabilize `const_extern_fn` closes https://github.com/rust-lang/rust/issues/64926 tracking issue: https://github.com/rust-lang/rust/issues/64926 reference PR: https://github.com/rust-lang/reference/pull/1596 ## Stabilizaton Report ### Summary Using `const extern "Rust"` and `const extern "C"` was already stabilized (since version 1.62.0, see https://github.com/rust-lang/rust/pull/95346). This PR stabilizes the other calling conventions: it is now possible to write `const unsafe extern "calling-convention" fn` and `const extern "calling-convention" fn` for any supported calling convention: ```rust const extern "C-unwind" fn foo1(val: u8) -> u8 { val + 1} const extern "stdcall" fn foo2(val: u8) -> u8 { val + 1} const unsafe extern "C-unwind" fn bar1(val: bool) -> bool { !val } const unsafe extern "stdcall" fn bar2(val: bool) -> bool { !val } ``` This can be used to const-ify an `extern fn`, or conversely, to make a `const fn` callable from external code. r? T-lang cc `@RalfJung`
2024-09-14stabilize `const_extern_fn`Folkert de Vries-6/+4
2024-09-10const-eval interning: accpt interior mutable pointers in final value (but ↵Ralf Jung-378/+74
keep rejecting mutable references)
2024-07-13consolidate miri-unleashed tests for mutable refs into one fileRalf Jung-427/+399
2024-07-11Always use a colon in `//@ normalize-*:` headersZalathar-8/+8
2024-05-02Stabilize exclusive_rangeRoss Smyth-1/+1
2024-04-17Validate before reporting interning errors.Oli Scherer-470/+112
validation produces much higher quality errors and already handles most of the cases
2024-04-17Validate nested static itemsOli Scherer-61/+131
2024-03-13include 32-bit variant for updated test of miri diagnostics.Felix S. Klock II-13/+167
2024-03-13Rebase. Update expected output to match current output.Felix S. Klock II-86/+38
2024-03-13Updated the test to include more output normalization.Felix S. Klock II-31/+34
2024-03-13Added `deny(const_eval_mutable_ptr_in_final_value)` attribute to all tests ↵Felix S. Klock II-59/+608
that were expecting the hard error for it. I attempted to do this in a manner that preserved the line numbers to reduce the review effort on the resulting diff, but we still have to deal with the ramifications of how a future-incompat lint behaves compared to a hard-error (in terms of its impact on the diagnostic output).
2024-02-29make mutable_references_err not bitwidth-dependentRalf Jung-361/+2
2024-02-29allow statics pointing to mutable staticsRalf Jung-1/+181
2024-02-19Always evaluate free constants and statics, even if previous errors occurredOli Scherer-36/+63
2024-02-18Improve wording of static_mut_refObei Sideg-69/+72
Rename `static_mut_ref` lint to `static_mut_refs`.
2024-02-17const_mut_refs: allow mutable refs to staticsRalf Jung-3/+3
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-28/+28
2024-02-16remove stderr-per-bitwidth from some testsRalf Jung-186/+34
2024-02-12allow static_mut_ref in some tests that specifically test mutable staticsRalf Jung-37/+7
2024-02-12Rollup merge of #120933 - RalfJung:const-check-misc, r=oli-obkMatthias Krüger-110/+0
check_consts: fix duplicate errors, make importance consistent This is stuff I noticed while working on https://github.com/rust-lang/rust/pull/120932, but it's orthogonal to that PR. r? ``@oli-obk``
2024-02-11check_consts: fix some duplicate errors by not calling check_static ↵Ralf Jung-110/+0
unnecessarily
2024-02-11Rollup merge of #120883 - RalfJung:extern-static-err, r=oli-obkMatthias Krüger-2/+43
interpret: rename ReadExternStatic → ExternStatic This error shows up for reads and writes, so `ReadExternStatic` is misleading.
2024-02-10validation: descend from consts into staticsRalf Jung-100/+178
2024-02-10unstably allow constants to refer to statics and read from immutable staticsRalf Jung-279/+160
2024-02-10interpret: rename ReadExternStatic → ExternStaticRalf Jung-2/+43
2024-01-28static mut: allow reference to arbitrary types, not just slices and arraysRalf Jung-20/+0