Playground
use std::collections::HashMap;
fn main() {
let m = HashMap::new();
m.insert( "foo", "bar" );
m.iter().map( |_, b| { // Stable ONLY:
// > [E0593]: closure is expected to take a single tuple as argument
b.to_string() // Stable + Beta + Nightly:
// > [E0619]: the type of this value must be known in this context
});
}
Commenting out the b.to_string() will yield the [E0593] error in all toolchains.
The [E0619] alone makes for a very confusing error message, as the user's assumption is that the type of b is correct.
Playground
Commenting out the
b.to_string()will yield the[E0593]error in all toolchains.The
[E0619]alone makes for a very confusing error message, as the user's assumption is that the type ofbis correct.