Skip to content

Guarantee that the global allocator never unwinds - #164200

Open
maxdexh wants to merge 1 commit into
rust-lang:mainfrom
maxdexh:global-alloc-nounwind
Open

maxdexh wants to merge 1 commit into
rust-lang:mainfrom
maxdexh:global-alloc-nounwind

Conversation

@maxdexh

@maxdexh maxdexh commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

With allocators about to be stabilized, we rely on this with Global already, since Allocator guarantees that there are no unwinds.

Unless we want Global.allocate and alloc::alloc to behave differently wrt unwinds (and add a bunch of unwind guards to the implementation of Global), I see no reason not to pass this guarantee down to users.

r? nia-e

@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 Oct 12, 2026
@rustbot

rustbot commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

nia-e is currently at their maximum review capacity.
They may take a while to respond.

@rustbot

This comment was marked as resolved.

@maxdexh maxdexh added the needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. label Oct 12, 2026
@maxdexh
maxdexh force-pushed the global-alloc-nounwind branch from b7002f0 to 79b55c8 Compare October 12, 2026 09:45
@nia-e

nia-e commented Oct 13, 2026

Copy link
Copy Markdown
Member

...does this need FCP? prior docs already state that this is just a stand-in for Global.allocate(), etc. - in fact we should deprecate these methods as per those docs and document that they pass on the behaviour & guarantees of the methods on Global

@maxdexh

maxdexh commented Oct 13, 2026 •

Copy link
Copy Markdown
Member Author

It's a new guarantee. I think the decision to not go through an FCP would be reasonable though (I'm fine with either way)

@maxdexh

maxdexh commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

Oh right I forgot about this PR.

r? clarfonthey

@rustbot rustbot assigned clarfonthey and unassigned nia-e Nov 8, 2026
@clarfonthey clarfonthey added the A-allocators Area: Custom and system allocators label Nov 9, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor

(Note: mostly haven't gotten to this yet because I haven't fully determined whether it needs FCP, and want to do that before deciding to FCP or merge.)

@maxdexh

maxdexh commented Nov 9, 2026 •

Copy link
Copy Markdown
Member Author

it's fine, i forgot this pr exists again before your message

@clarfonthey

Copy link
Copy Markdown
Contributor

Yeah, as mentioned earlier, I'm just going to go with "if there's any doubt, just do FCP."

This might technically be made elsewhere but I think it's simple enough people won't have any issues.

@rfcbot merge libs

@rust-rfcbot

rust-rfcbot commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

@clarfonthey has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/libs-ping: FCP proposed for libs, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. and removed needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. labels Nov 13, 2026
@clarfonthey clarfonthey added S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 13, 2026

@clarfonthey clarfonthey left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-bors

This comment has been minimized.

@maxdexh
maxdexh force-pushed the global-alloc-nounwind branch from 79b55c8 to c2de5fb Compare November 23, 2026 08:56
@rustbot

rustbot commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@maxdexh
maxdexh force-pushed the global-alloc-nounwind branch from c2de5fb to b4ee882 Compare November 23, 2026 09:03
@maxdexh
maxdexh force-pushed the global-alloc-nounwind branch from b4ee882 to f7ae271 Compare November 23, 2026 09:11

This branch has not been deployed

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

Labels

A-allocators Area: Custom and system allocators disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. 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