Should std::slice::from_raw_parts document that slices larger than isize::MAX are unsound? #53676
Labels
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
Indexing into a slice relies on
ptr::offset
, which says that its UB to use an offset/index larger thanisize::MAX
. As documented byptr::offset
, "memory acquired directly from allocators or memory mapped files may be too large to handle with this function." Does that mean that e.g. memory mapping a file larger thanisize::MAX
into a slice is unsound, because safe code can cause UB just by indexing into it? Should thefrom_raw_parts
docs tell callers that they need to check this?The text was updated successfully, but these errors were encountered: