rust/tests/ui/consts/const-eval
Matthias Krüger c796ef00f8
Rollup merge of #140521 - RalfJung:oob-error, r=saethlin
interpret: better error message for out-of-bounds pointer arithmetic and accesses

Fixes https://github.com/rust-lang/rust/issues/93881
r? `@saethlin`
2025-05-02 19:37:58 +02:00
..
auxiliary
heap compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
simd make simd_insert and simd_extract const fns 2025-02-27 12:23:00 +01:00
stable-metric Filter empty lines, comments and delimiters from previous to last multiline span rendering 2024-12-12 23:36:27 +00:00
assign-to-static-within-other-static.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
assign-to-static-within-other-static.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
conditional_array_execution.rs
conditional_array_execution.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
const_fn_ptr_fail2.rs compiletest: Support matching on diagnostics without a span 2025-03-25 17:33:09 +03:00
const_fn_ptr_fail2.stderr Shorten span of panic failures in const context 2025-02-28 16:28:41 +00:00
const_fn_ptr_fail.rs compiletest: Support matching on diagnostics without a span 2025-03-25 17:33:09 +03:00
const_fn_ptr_fail.stderr
const_fn_ptr.rs compiletest: Support matching on diagnostics without a span 2025-03-25 17:33:09 +03:00
const_fn_ptr.stderr Always evaluate free constants and statics, even if previous errors occurred 2024-02-19 22:11:13 +00:00
const_fn_target_feature_wasm.rs interpret: do not make const-eval query result depend on tcx.sess 2024-08-26 17:08:52 +02:00
const_fn_target_feature.rs interpret: do not make const-eval query result depend on tcx.sess 2024-08-26 17:08:52 +02:00
const_let.rs
const_let.stderr
const_panic_2021.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const_panic_2021.stderr Do not suggest using -Zmacro-backtrace for builtin macros 2025-03-14 19:50:03 +00:00
const_panic_libcore_bin.rs
const_panic_libcore_bin.stderr Do not suggest using -Zmacro-backtrace for builtin macros 2025-03-14 19:50:03 +00:00
const_panic_stability.e2018.stderr
const_panic_stability.e2021.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
const_panic_stability.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const_panic_track_caller.rs Shorten span of panic failures in const context 2025-02-28 16:28:41 +00:00
const_panic_track_caller.stderr Shorten span of panic failures in const context 2025-02-28 16:28:41 +00:00
const_panic-normalize-tabs-115498.rs Don't forget to normalize the translated message 2023-09-03 17:10:42 +02:00
const_panic-normalize-tabs-115498.stderr Do not suggest using -Zmacro-backtrace for builtin macros 2025-03-14 19:50:03 +00:00
const_panic.rs
const_panic.stderr Do not suggest using -Zmacro-backtrace for builtin macros 2025-03-14 19:50:03 +00:00
const_prop_errors.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const_raw_ptr_ops2.rs interpret: better error message for out-of-bounds pointer arithmetic and accesses 2025-04-30 18:45:41 +02:00
const_raw_ptr_ops2.stderr interpret: better error message for out-of-bounds pointer arithmetic and accesses 2025-04-30 18:45:41 +02:00
const_raw_ptr_ops.rs fix library and rustdoc tests 2023-04-16 11:38:52 +00:00
const_raw_ptr_ops.stderr fix library and rustdoc tests 2023-04-16 11:38:52 +00:00
const_signed_pat.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-eval-intrinsic-promotion.rs
const-eval-intrinsic-promotion.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
const-eval-overflow2.rs
const-eval-overflow2.stderr
const-eval-overflow2b.rs
const-eval-overflow2b.stderr
const-eval-overflow2c.rs
const-eval-overflow2c.stderr
const-eval-overflow-2.rs Tweak unevaluated constant in pattern error 2024-12-04 20:29:35 +00:00
const-eval-overflow-2.stderr Tweak unevaluated constant in pattern error 2024-12-04 20:29:35 +00:00
const-eval-overflow-3.rs
const-eval-overflow-3.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
const-eval-overflow-3b.rs
const-eval-overflow-3b.stderr Don't call const normalize in error reporting 2024-09-22 13:55:06 -04:00
const-eval-overflow-4.rs
const-eval-overflow-4.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
const-eval-overflow-4b.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
const-eval-overflow-4b.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
const-eval-query-stack.rs Remove the -test suffix from normalize directives 2024-12-27 19:58:16 +11:00
const-eval-query-stack.stderr Try to write the panic message with a single write_all call 2025-01-01 15:58:29 +01:00
const-eval-span.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
const-eval-span.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
const-pointer-values-in-various-types.64bit.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
const-pointer-values-in-various-types.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
dont_promote_unstable_const_fn_cross_crate.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dont_promote_unstable_const_fn_cross_crate.stderr
dont_promote_unstable_const_fn.rs Re-do recursive const stability checks 2024-10-25 20:31:40 +02:00
dont_promote_unstable_const_fn.stderr Fix typo in const stability error message 2025-01-25 21:43:22 +08:00
double_check2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
double_check.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
duration_conversion.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
enum_discr.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern_fat_pointer.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
field-access-after-const-eval-fail-in-ty.rs Check for presence of field in typeck results before visiting it 2024-02-03 19:41:18 +01:00
field-access-after-const-eval-fail-in-ty.stderr Check for presence of field in typeck results before visiting it 2024-02-03 19:41:18 +01:00
float_methods.rs Stabilize const_float_methods 2024-11-23 18:42:44 +01:00
format.rs Add test for format_args!("{}", 0) in const. 2025-04-30 13:18:21 +02:00
format.stderr Clean up "const" situation in format_args!(). 2025-05-01 11:55:23 +02:00
generic-slice.rs
generic-slice.stderr Always evaluate free constants and statics, even if previous errors occurred 2024-02-19 22:11:13 +00:00
ice-generic-assoc-const.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
ice-packed.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
ice-unhandled-type-122191.rs Implement #[define_opaque] attribute for functions. 2025-03-11 12:05:02 +00:00
ice-unhandled-type-122191.stderr Implement #[define_opaque] attribute for functions. 2025-03-11 12:05:02 +00:00
ice-unsized-struct-const-eval-123154.rs Fail candidate assembly for erroneous types 2024-04-16 12:42:48 +05:30
ice-unsized-struct-const-eval-123154.stderr Fail candidate assembly for erroneous types 2024-04-16 12:42:48 +05:30
index_out_of_bounds_propagated.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
index_out_of_bounds_propagated.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
index_out_of_bounds.rs
index_out_of_bounds.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
index-out-of-bounds-never-type.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
index-out-of-bounds-never-type.stderr preserve span when evaluating mir::ConstOperand 2024-03-14 21:55:07 +01:00
infinite_loop.eval_limit.stderr Tweak multispan rendering 2024-12-12 23:36:27 +00:00
infinite_loop.no_ice.stderr Tweak multispan rendering 2024-12-12 23:36:27 +00:00
infinite_loop.rs Fix crash in late internal checking 2024-03-08 19:00:53 +08:00
issue-43197.rs
issue-43197.stderr
issue-44578.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
issue-44578.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
issue-47971.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-49296.rs
issue-49296.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-50706.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-50814-2.mir-opt.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
issue-50814-2.normal.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
issue-50814-2.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
issue-50814.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
issue-50814.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
issue-51300.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-52475.rs Remove const eval limit and implement an exponential backoff lint instead 2023-05-31 10:24:17 +00:00
issue-52475.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-53157.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-53401.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-55541.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-64908.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-64970.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-65394.rs stabilize const_mut_refs 2024-09-15 09:51:32 +02:00
issue-65394.stock.stderr stabilize const_mut_refs 2024-09-15 09:51:32 +02:00
issue-70723.rs Remove const eval limit and implement an exponential backoff lint instead 2023-05-31 10:24:17 +00:00
issue-70723.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-70804-fn-subtyping.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-84957-const-str-as-bytes.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-85155.rs compiletest: Support matching on diagnostics without a span 2025-03-25 17:33:09 +03:00
issue-85155.stderr preserve span when evaluating mir::ConstOperand 2024-03-14 21:55:07 +01:00
issue-85907.rs
issue-85907.stderr Do not suggest using -Zmacro-backtrace for builtin macros 2025-03-14 19:50:03 +00:00
issue-91827-extern-types-field-offset.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
issue-91827-extern-types-field-offset.stderr don't ICE when encountering an extern type field during validation 2024-06-22 17:39:01 +02:00
issue-100878.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-104390.rs
issue-104390.stderr Make parse error suggestions verbose and fix spans 2024-07-12 03:02:57 +00:00
livedrop.rs
livedrop.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
match-test-ptr-null.rs
match-test-ptr-null.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
mod-static-with-const-fn.rs stabilize const_mut_refs 2024-09-15 09:51:32 +02:00
mod-static-with-const-fn.stderr stabilize const_mut_refs 2024-09-15 09:51:32 +02:00
no_lint_for_statically_known_error.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
nonnull_as_ref_ub.rs don't UB on dangling ptr deref, instead check inbounds on projections 2023-10-15 18:12:46 +02:00
nonnull_as_ref_ub.stderr interpret: better error message for out-of-bounds pointer arithmetic and accesses 2025-04-30 18:45:41 +02:00
nonnull_as_ref.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
nrvo.rs stabilize const_mut_refs 2024-09-15 09:51:32 +02:00
panic-assoc-never-type.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
panic-assoc-never-type.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
panic-never-type.rs
panic-never-type.stderr Do not suggest using -Zmacro-backtrace for builtin macros 2025-03-14 19:50:03 +00:00
parse_ints.rs Shorten span of panic failures in const context 2025-02-28 16:28:41 +00:00
parse_ints.stderr Shorten span of panic failures in const context 2025-02-28 16:28:41 +00:00
partial_ptr_overwrite.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
partial_ptr_overwrite.stderr stabilize const_mut_refs 2024-09-15 09:51:32 +02:00
promote_mutable_zst_mir_borrowck.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
promote-static.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
promoted_const_fn_fail_deny_const_err.rs
promoted_const_fn_fail_deny_const_err.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
promoted_const_fn_fail.rs
promoted_const_fn_fail.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
promoted_raw_ptr_ops.rs
promoted_raw_ptr_ops.stderr
ptr-to-int-transmute-in-consts-issue-87525.rs Add a Lint for Pointer to Integer Transmutes in Consts 2024-10-05 12:48:02 +00:00
ptr-to-int-transmute-in-consts-issue-87525.stderr Add a Lint for Pointer to Integer Transmutes in Consts 2024-10-05 12:48:02 +00:00
raw-bytes.32bit.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
raw-bytes.64bit.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
raw-bytes.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
raw-pointer-ub.rs interpret: better error message for out-of-bounds pointer arithmetic and accesses 2025-04-30 18:45:41 +02:00
raw-pointer-ub.stderr interpret: better error message for out-of-bounds pointer arithmetic and accesses 2025-04-30 18:45:41 +02:00
ref_to_int_match.32bit.stderr fix test 2024-12-04 20:29:36 +00:00
ref_to_int_match.64bit.stderr Tweak unevaluated constant in pattern error 2024-12-04 20:29:35 +00:00
ref_to_int_match.rs Tweak unevaluated constant in pattern error 2024-12-04 20:29:35 +00:00
shift_overflow.rs
shift_overflow.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
simple_with_undef.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
size-of-t.rs
size-of-t.stderr generic_const_exprs: suggest to add the feature, not use it 2023-11-30 20:59:51 +01:00
strlen.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
transmute-const-promotion.rs Suggest {to,from}_ne_bytes for transmutations between arrays and integers, etc 2025-04-24 13:14:36 +07:00
transmute-const-promotion.stderr Suggest {to,from}_ne_bytes for transmutations between arrays and integers, etc 2025-04-24 13:14:36 +07:00
transmute-const.rs Suggest {to,from}_ne_bytes for transmutations between arrays and integers, etc 2025-04-24 13:14:36 +07:00
transmute-const.stderr Suggest {to,from}_ne_bytes for transmutations between arrays and integers, etc 2025-04-24 13:14:36 +07:00
transmute-size-mismatch.rs Shorten span of panic failures in const context 2025-02-28 16:28:41 +00:00
transmute-size-mismatch.stderr Shorten span of panic failures in const context 2025-02-28 16:28:41 +00:00
ub-enum-overwrite.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
ub-enum-overwrite.stderr stabilize const_mut_refs 2024-09-15 09:51:32 +02:00
ub-enum.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
ub-enum.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
ub-incorrect-vtable.32bit.stderr interpret: make identity upcasts a NOP again to avoid them generating a new random vtable 2024-08-09 18:48:45 +02:00
ub-incorrect-vtable.64bit.stderr interpret: make identity upcasts a NOP again to avoid them generating a new random vtable 2024-08-09 18:48:45 +02:00
ub-incorrect-vtable.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
ub-int-array.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
ub-int-array.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
ub-invalid-values.rs Shorten span of panic failures in const context 2025-02-28 16:28:41 +00:00
ub-invalid-values.stderr Shorten span of panic failures in const context 2025-02-28 16:28:41 +00:00
ub-nonnull.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
ub-nonnull.stderr Rollup merge of #140521 - RalfJung:oob-error, r=saethlin 2025-05-02 19:37:58 +02:00
ub-ref-ptr.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
ub-ref-ptr.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
ub-slice-get-unchecked.rs remove const_slice_index annotations, it never had a feature gate anyway 2024-09-08 23:08:43 +02:00
ub-slice-get-unchecked.stderr Note def descr in NonConstFunctionCall 2024-12-23 22:15:32 +00:00
ub-uninhabit.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
ub-uninhabit.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
ub-upvars.32bit.stderr also print 'immutable' flag 2023-12-07 17:46:36 +01:00
ub-upvars.64bit.stderr also print 'immutable' flag 2023-12-07 17:46:36 +01:00
ub-upvars.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
ub-wide-ptr.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
ub-wide-ptr.stderr interpret: make identity upcasts a NOP again to avoid them generating a new random vtable 2024-08-09 18:48:45 +02:00
ub-write-through-immutable.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
ub-write-through-immutable.stderr also stabilize const_refs_to_cell 2024-09-15 10:20:47 +02:00
union_promotion.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
union_promotion.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
union-const-eval-field.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
union-const-eval-field.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
union-ice.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
union-ice.stderr
union-ub.32bit.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
union-ub.64bit.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
union-ub.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
unused-broken-const.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused-broken-const.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unwind-abort.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
unwind-abort.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
valid-const.rs Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
validate_uninhabited_zsts.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
validate_uninhabited_zsts.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
validation-ice-extern-type-field.rs Update tests. 2025-01-07 16:04:14 +01:00
validation-ice-extern-type-field.stderr don't ICE when encountering an extern type field during validation 2024-06-22 17:39:01 +02:00
write-to-uninhabited-enum-variant.rs Update tests 2024-08-10 12:07:17 +02:00
zst_operand_eval.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00