Uh oh!
There was an error while loading. Please reload this page.
data_structures: Add deterministic FxHashMap and FxHashSet wrappers - #64131
Conversation
rust-highfive
commented
Sep 3, 2019
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cramertj (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Hi @bjorn3! |
Uh oh!
There was an error while loading. Please reload this page.
shivan1b
commented
Sep 3, 2019
r? @bjorn3 |
Mark-Simulacrum
commented
Sep 3, 2019
But they will be if we decide to merge this (bors includes PR message in merge commit). I'd also like to see this called something like |
Mark-Simulacrum
commented
Sep 3, 2019
We'll probably want a Set variant of the map as well. For sorted vector support something like the following would work: fninto_sorted_vector(self) -> Vec<(K,V)>/* or Vec<T> */whereK:PartialOrd,V:PartialOrd,{letmut v = self.base.into_iter().collect::<Vec<_>>();
v.unstable_sort();// this is interesting in that it's unstable but we're not actually adding instability here since the underlying map already has an unstable iteration order
v
} |
bjorn3
left a comment
There was a problem hiding this comment.
Please rustfmt dfx.rs (but not the rest of the files, so you will need to run rustfmt /path/to/dfx.rs instead of cargo fmt.)
Apart from a few nits this looks good. @Mark-Simulacrum should this PR contain a first user of the new api, or can that be done in a follow-up?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
shivan1b
commented
Sep 3, 2019
Right. Forgot about it. I shall remove them before merging unless you think it makes sense to have them as a part of commit message?
Shall I go with |
bjorn3
commented
Sep 3, 2019
I prefer |
shivan1b
commented
Sep 3, 2019
Sure. Should I be creating a separate issue for this?
Thank you very much! |
Mark-Simulacrum
commented
Sep 3, 2019
I think adding the set in this PR makes sense; it should be minimally difficult to do so, hopefully.
Yeah, I don't think the examples are too useful.
I think that moving the compiler over can be done in followup PRs. It'll likely be fairly straightforward (mostly just search and replace on |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Alexendoo
commented
Sep 18, 2019
Ping from triage, any updates? @cramertj |
Mark-Simulacrum
commented
Sep 18, 2019
r=me with commits squashed into one |
JohnCSimon
commented
Sep 28, 2019
Ping from triage: |
StableMap A wrapper for FxHashMap that allows to insert, remove, get and get_mut but no iteration support. StableSet A wrapper for FxHashSet that allows to insert, remove, get and create a sorted vector from a hashset but no iteration support.
b43f570 to
800bd3aCompareshivan1b
commented
Sep 28, 2019
Sorry @JohnCSimon for having missed that. |
Mark-Simulacrum
commented
Sep 28, 2019
@bors r+ rollup Thanks! |
bors
commented
Sep 28, 2019
📌 Commit 800bd3a has been approved by |
…=Mark-Simulacrum data_structures: Add deterministic FxHashMap and FxHashSet wrappers StableMap A wrapper for FxHashMap that allows to `insert`, `remove`, `get`, `get_mut` and convert a hashmap into a sorted vector using the method `into_sorted_vector` but no iteration support. StableSet A wrapper for FxHashSet that allows to `insert`, `remove`, `get` and convert a hashset into a sorted vector using the method `into_sorted_vector` but no iteration support. Addresses issue rust-lang#63713
Rollup of 10 pull requests Successful merges: - #64131 (data_structures: Add deterministic FxHashMap and FxHashSet wrappers) - #64387 (Fix redundant semicolon lint interaction with proc macro attributes) - #64678 (added more context for duplicate lang item errors (fixes#60561)) - #64763 (Add E0734 and its long explanation) - #64793 (Fix format macro expansions spans to be macro-generated) - #64837 (Improve wording in documentation of MaybeUninit) - #64852 (Print ParamTy span when accessing a field (#52082)) - #64875 (Upgrade async/await to "used" keywords.) - #64876 (Fix typo in intrinsics op safety) - #64880 (Slice docs: fix typo) Failed merges: r? @ghost
StableMap
A wrapper for FxHashMap that allows to
insert,remove,get,get_mutand convert a hashmap into a sorted vector using the methodinto_sorted_vectorbut no iteration support.StableSet
A wrapper for FxHashSet that allows to
insert,remove,getand convert a hashset into a sorted vector using the methodinto_sorted_vectorbut no iteration support.Addresses issue #63713