Skip to content

offset_from, offset: clearly separate safety requirements the user needs to prove from corollaries that automatically follow#127275

Merged
bors merged 2 commits into
rust-lang:masterfrom
RalfJung:offset-from-isize-min
Jul 6, 2024
Merged

offset_from, offset: clearly separate safety requirements the user needs to prove from corollaries that automatically follow#127275
bors merged 2 commits into
rust-lang:masterfrom
RalfJung:offset-from-isize-min

Conversation

@RalfJung

@RalfJung RalfJung commented Jul 3, 2024

Copy link
Copy Markdown
Member

By landing #116675 we decided that objects larger than isize::MAX cannot exist in the address space of a Rust program, which lets us simplify these rules.

For offset_from, we can even state that the absolute distance fits into an isize, and therefore exclude isize::MIN. This PR also changes Miri to treat an isize::MIN difference like the other isize-overflowing cases.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants