Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide allocator details and default to Global #227

Merged
merged 6 commits into from
Jan 18, 2021

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Jan 18, 2021

This is a breaking change!

We no longer re-export the unstable allocator items from the standard library, nor the stable shims approximating the same. The choice was predicated on the "nightly" feature, but crates that did not set that feature could be forced into it by others in the dependency tree, and then fail for lack of #![feature(allocator_api)] when referencing these items. All types have been audited to have a default A=Global to make sure the type doesn't need to be named for stable users. Fixes #226.

Many of the parallel iterators don't need the S hasher or A allocator at all if they convert to a tighter inner type upon construction. This has been cleaned up, and those that do still need A now default to A=Global.

RawTable::with_capacity and try_with_capacity have moved back to being methods for Global only. New with_capacity_in and try_with_capacity_in methods allow custom allocators, with the alloc parameter last to match the similar methods on HashMap and HashSet.

@Amanieu
Copy link
Member

Amanieu commented Jan 18, 2021

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 18, 2021

📌 Commit dac885a has been approved by Amanieu

@bors
Copy link
Collaborator

bors commented Jan 18, 2021

⌛ Testing commit dac885a with merge 496b1bc...

@bors
Copy link
Collaborator

bors commented Jan 18, 2021

☀️ Test successful - checks-travis
Approved by: Amanieu
Pushing 496b1bc to master...

@bors bors merged commit 496b1bc into rust-lang:master Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RawTable allocator can't be used by stable code
3 participants