Unclear is offsetting one element past array length is allowed #138969
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
A-raw-pointers
Area: raw pointers, MaybeUninit, NonNull
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
T-opsem
Relevant to the opsem team
Location
https://doc.rust-lang.org/std/primitive.pointer.html#method.offset
Summary
Offset doc states that
allocated object doc states that
so as i understand offsetting pointer to the head of an array one past it's length should not be allowed, but in practice it is allowed
this code compiles just fine, but this one produces an error
The text was updated successfully, but these errors were encountered: