Skip to content

Commit

Permalink
Auto merge of #227 - cuviper:alloc-defaults, r=Amanieu
Browse files Browse the repository at this point in the history
Hide allocator details and default to Global

**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`.
  • Loading branch information
bors committed Jan 18, 2021
2 parents 9beb06b + dac885a commit 496b1bc
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 161 deletions.
Loading

0 comments on commit 496b1bc

Please sign in to comment.