about summary refs log tree commit diff
path: root/tests/ui/limits
AgeCommit message (Collapse)AuthorLines
2025-08-30compiler: Include span of too huge array with `-Cdebuginfo=2`Martin Nordholts-3/+42
We have a few ui tests to ensure we emit an error if we encounter too big arrays. Before this fix, compiling the tests with `-Cdebuginfo=2` would not include the spans of the instantiation sites, because the error is then emitted from a different code path that does not include the span. Propagate the span to the error also in the debuginfo case, so the tests passes regardless of debuginfo level.
2025-08-28compiler: Include span of too huge enum with -Cdebuginfo=2Martin Nordholts-4/+14
We have a ui test to ensure we emit an error if we encounter too big enums. Before this fix, compiling the test with `-Cdebuginfo=2` would not include the span of the instantiation site, because the error is then emitted from a different code path that does not include the span. Propagate the span to the error also in the debuginfo case, so the test passes regardless of debuginfo level.
2025-08-22ci: Begin running ui tests with `rust.debuginfo-level-tests=1`Martin Nordholts-1/+4
To reduce risk of regressing on generating debuginfo e.g. in the form of ICE:s. This will also ensure that future ui tests support different debuginfo levels. When I looked at run time for different CI jobs, **x86_64-gnu-debug** was far from the bottle neck, so it should be fine to make it perform more work.
2025-08-06Add support for shortening `Instance` and use itEsteban Küber-3/+4
Replace ad-hoc type path shortening logic for recursive mono instantiation errors to use `tcx.short_string()` instead.
2025-07-10cleaned up some testsKivooeo-9/+11
2025-07-01moved testsKivooeo-0/+49
2025-06-07const-eval error: always say in which item the error occurredRalf Jung-3/+3
also adjust the wording a little so that we don't say "the error occurred here" for two different spans
2025-06-02Clarify why we are talking about a failed const eval at a random placeOli Scherer-3/+3
2025-06-02Use the informative error as the main const eval error messageOli Scherer-16/+13
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-3/+4
2025-02-28Shorten span of panic failures in const contextEsteban Küber-7/+3
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-27Simplify or delete normalize directives that don't care about bit-widthZalathar-6/+3
2024-12-01fix ICE when promoted has layout size overflowRalf Jung-17/+0
2024-09-20TL note: current means targetJubilee Young-20/+20
2024-09-20Normalize being an annoying little compile testJubilee Young-3/+5
The issue-112505-overflow test just extended a case of transmute-fail.rs so simply put them in the same file. Then we normalize away other cases of this.
2024-09-19Bless rustc_abi::obj_size_bound testsJubilee Young-1/+1
2024-09-19Keep object-size-dependent tests failingJubilee Young-1/+1
These tests depend on the internal logic of rustc regarding handling very large objects. Fix them to reflect rustc_abi::obj_size_bound diffs.
2024-09-19bless issue-56762.rs as huge-static.rsJubilee Young-6/+9
2024-07-11Always use a colon in `//@ normalize-*:` headersZalathar-7/+7
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-29/+29
2023-11-24Manual find replace updatesNilstrieb-2/+2
2023-11-24Show number in error message even for one errorNilstrieb-9/+9
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-05Add a note to duplicate diagnosticsAlex Macleod-0/+1
2023-09-14don't point at const usage site for resolution-time errorsRalf Jung-2/+2
also share the code that emits the actual error
2023-09-12cleanup leftovers of const_err lintRalf Jung-8/+12
2023-07-29cg_llvm: remove pointee types and pointercast/bitcast-of-ptrErik Desjardins-0/+1
2023-07-05Remove some unnecessary normalizationBen Kimock-42/+9
2023-04-15Only enable ConstProp at mir-opt-level >= 2.Camille GILLOT-8/+0
2023-01-18i am freeBoxy-3/+3
2023-01-18defer array len printing to const arg printingBoxy-5/+5
2023-01-11Move /src/test to /testsAlbert Larsan-0/+341