Files
rust/library/core/src/slice
Stuart Cook bdedfdd557 Rollup merge of #161616 - bardiharborow:get-unchecked-index-precondition-const-eval, r=RalfJung
Report precondition violation for `<usize as SliceIndex>::get_unchecked` in const-eval

The precondition check was gated on `check_language_ub`, which is disabled in const-eval and Miri, on the grounds that the `assume` below it is language UB that the interpreter will catch anyway. It does catch it, but only as "`assume` called with `false`", which says nothing about what the caller did wrong.

This PR instead gates the check on `check_library_ub`, matching `get_unchecked_mut`, so that the interpreter reports the violated precondition.

Fixes rust-lang/rust#161611
2026-09-05 23:04:50 +10:00
..
2026-08-25 18:15:15 +00:00
2026-09-01 08:57:20 -05:00
2026-08-25 18:15:08 +00:00
2026-08-28 20:27:31 +02:00
…
…