rust/library/core
Matthias Krüger 7096ec3e00
Rollup merge of #117039 - scottmcm:clarify-get-unchecked, r=cuviper
Clarify UB in `get_unchecked(_mut)`

Inspired by #116915, it was unclear to me what exactly "out-of-bounds index" means in `get_unchecked`.

One could [potentially](https://rust.godbolt.org/z/hxM764orW) interpret it that `get_unchecked` is just another way to write `offset`, but I think `get_unchecked(len)` is supposed to be UB even though `.offet(len)` is well-defined (as is `.get_unchecked(..len)`), so write that more directly in the docs.

**libs-api folks**: Can you confirm whether this is what you expect this to mean?  And is the situation any different for `<*const [T]>::get_unchecked`?
2023-11-10 01:50:24 +01:00
..
benches fix 2023-07-23 09:58:31 +00:00
src Rollup merge of #117039 - scottmcm:clarify-get-unchecked, r=cuviper 2023-11-10 01:50:24 +01:00
tests Move BorrowedBuf and BorrowedCursor from std:io to core::io 2023-11-09 07:10:11 +09:00
Cargo.toml Update rand in the stdlib tests, and remove the getrandom feature from it 2023-01-04 14:52:41 -08:00