-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-type-systemArea: Type systemArea: Type system
Milestone
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 }
Metadata
Metadata
Assignees
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-type-systemArea: Type systemArea: Type system