Closed
Description
I made this typo in some code I was writing just now, a colon in place of a semicolon after a function call, with another function call on the next line:
fn f() {}
fn main() {
f():
f();
}
The compiler errors with:
rustc 1.17.0 (56124baa9 2017-04-24)
error[E0573]: expected type, found function `f`
--> <anon>:5:5
|
5 | f();
| ^^^ not a type
This is technically correct, but it was confusing and it took me a few minutes to realize what I had done. It would be nicer if we could guess in some circumstances that the user probably meant to put a semicolon there and say something to that effect.