Closed
Description
In this error keys
is not a function that can be iterated with for
, and I stared at this error message for a long time before realizing that.
It's not clear here what types are mismatched and why. It seems like maybe the expected and actual are reversed. Even so, it would be nice to have some for
-specific error.
../src/librustsyntax/parse/token.rs:226:37: 228:5 error: mismatched types: expected `()` but found `bool` (() vs bool)
../src/librustsyntax/parse/token.rs:226 for bad_expr_word_table().keys() {|word|
../src/librustsyntax/parse/token.rs:227 keywords.insert(word, ());
../src/librustsyntax/parse/token.rs:228 }
../src/librustsyntax/parse/token.rs:226:37: 228:5 error: mismatched types: expected `fn(&&str)` but found `fn(&&str) -> bool` (() vs bool)
../src/librustsyntax/parse/token.rs:226 for bad_expr_word_table().keys() {|word|
../src/librustsyntax/parse/token.rs:227 keywords.insert(word, ());
../src/librustsyntax/parse/token.rs:228 }