Skip to content

doc: clarify allocator invariant#153985

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
lms0806:issue-153542
Mar 18, 2026
Merged

doc: clarify allocator invariant#153985
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
lms0806:issue-153542

Conversation

@lms0806
Copy link
Contributor

@lms0806 lms0806 commented Mar 17, 2026

Added base + size <= usize::MAX to the Allocator documentation.

Please refer to issue 153542.

Close #153542

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 17, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 17, 2026

r? @scottmcm

rustbot has assigned @scottmcm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @scottmcm, libs
  • @scottmcm, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, joboet, scottmcm

@scottmcm
Copy link
Member

I was pondering where best to put this, and whether it should be more related to the "currently allocated" conversations, but in the end I think here is good. If you wanted to be hyper-specific about a "proof" for why a offset didn't wrap, you'd want something in the safety section here, since the methods on the trait themselves can't impose postconditions that can be relied upon for soundness.

And I think this is "obviously" a requirement here, so as the trait is unstable I think I'm good to just 👍 it without involving an FCP from any team. They can look at it when contemplating stabilizing the trait.

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 18, 2026

📌 Commit 57fe818 has been approved by scottmcm

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 18, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 18, 2026
doc: clarify allocator invariant

Added base + size <= usize::MAX to the Allocator documentation.

Please refer to issue [153542](rust-lang#153542).

Close rust-lang#153542
rust-bors bot pushed a commit that referenced this pull request Mar 18, 2026
Rollup of 3 pull requests

Successful merges:

 - #153677 (Remove string content from panics)
 - #153945 (Change `?Sized` to `PointeeSized` in `UnwindSafe` impls for pointers)
 - #153985 (doc: clarify allocator invariant)
@rust-bors rust-bors bot merged commit 43e4859 into rust-lang:main Mar 18, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 18, 2026
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-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.

GlobalAlloc and Allocator traits missing base + size <= usize::MAX from the allocation conditions

3 participants