You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rust recently added into_keys and into_values that consume self and return an iterator over the moved keys or values. This doesn't work with AHashMap because the new functions are used by AHashMap via Deref<Target = HashMap<K, V, S>>:
error[E0507]: cannot move out of dereference of `AHashMap<&str, i64>`
--> src/file.rs:30:5
|
30 | tbl.into_values().max()
| ^^^^-------------
| | |
| | value moved due to this method call
| move occurs because value has type `HashMap<&str, i64, ahash::RandomState>`, which does not implement the `Copy` trait
|
note: this function takes ownership of the receiver `self`, which moves value
--> /home/dsemi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs:454:24
|
454 | pub fn into_values(self) -> IntoValues<K, V> {
| ^^^^
The text was updated successfully, but these errors were encountered:
Rust recently added
into_keys
andinto_values
that consumeself
and return an iterator over the moved keys or values. This doesn't work with AHashMap because the new functions are used byAHashMap
viaDeref<Target = HashMap<K, V, S>>
:The text was updated successfully, but these errors were encountered: