-
Notifications
You must be signed in to change notification settings - Fork 166
Possible changes for 2.0 #135
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
Comments
Added item for a proper |
If we adopt MSRV 1.36 and a new default hasher, I think there will be no more need for |
I just have an attitude problem with ahash, would be more charmed by a pure-rust hash function. But for an actual argument, for a public dependency we need them to have an 1.x version or equivalent. |
Are there any plans to support the Allocator trait/allocator_api feature? |
I've thought about (I'm generally not inclined to use unstable features in this crate, not even behind a feature flag.) |
Thanks for taking a minute to explain the issue. I have a use case for this, but I'm with you on not wanting to support unstable features, so I'm happy if it's on the "probably at some point after stabilization if we feel like it" list. |
) ## Summary We plan on allocating the AST using a bump pointer allocator. This means that all collections in the AST must use the allocator API. We can use the `allocator_api2` crate for simple built-in collections like `Vec` but all more complex, non-std, and custom collections must find a way to support the allocator API. The hardest of these collections is the third party `indexmap` crate which does not support the allocator API, and [does not plan to](indexmap-rs/indexmap#135 (comment)) until the allocator API is stabilized. We currently use `IndexMap` in AST scope nodes. Unfortunately there does not appear to be an `IndexMap` alternative supporting the allocator API. Instead we took the step of forking `indexmap` and patching the latest version (2.7.1) with support for the allocator API across almost the entire API surface at https://github.com/Hans-Halverson/indexmap-allocator-api. [This is the patch](Hans-Halverson/indexmap-allocator-api@4e33c59) that was used. The forked `indexmap-allocator-api` is then used as a drop-in replacement for the `indexmap` crate (implicitly using the global allocator), and can be created with explicit allocators in future PRs. ## Tests All tests pass.
Let's use this issue to discuss changes for a hypothetical 2.0.
Proposed
serde_json
supports Rust 1.31.RangeBounds
.hashbrown
.TryFrom
/TryInto
which may be useful for custom indexing.alloc
support.indexmap
1.5, and MSRV 1.36 in 1.6hashbrown
defaults toahash
.no_std
default would be nice.Idx = usize
, this doesn't always work well with type inference.remove()
?std
crate featurePartialEq + Eq
, more likeVec
thanHashMap
(IndexMap / IndexSet comparison isn't order-aware. #153, map: Make Eq comparisons ordering-aware. #154).PartialOrd
,Ord
, andHash
.get_index_mut
should return&K
instead of&mut K
(Add more Vec/slice-like methods to maps and sets #160 (comment))The text was updated successfully, but these errors were encountered: