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)

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

needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants