-
Notifications
You must be signed in to change notification settings - Fork 130
Closed
Description
with_capacity_and_hasher requires K to implement Eq:
error[E0277]: the trait bound `K: Hash` is not satisfied
--> compiler/rustc_data_structures/src/sso/map.rs:89:29
|
89 | SsoHashMap::Map(FxHashMap::with_capacity_and_hasher(cap, Default::default()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Hash` is not implemented for `K`
|
= note: required by `AHashMap::<K, V, S>::with_capacity_and_hasher`
Consider relaxing that bound, I think you shouldn't need it for constructing the hashmap, only for operations involving the elements (get/set/entry). Same request for various other functions, new(), capacity(), len(), etc.
Note the error is misleading here - FxHashMap is an alias for AHashMap that I renamed because it was simpler than changing a hundred imports.
Originally posted by @jyn514 in rust-lang/rust#77996 (comment)
Metadata
Metadata
Assignees
Labels
No labels