-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Description
I mistyped a ; as a : because it was following a ) which requires holding the shift key on American keyboards. It would be nice if the error message mentioned why it was expecting a type.
Sample code:
fn main() {
println!("test"):
0;
}
Current error:
rustc 1.17.0 (56124baa9 2017-04-24)
error: expected type, found `0`
--> <anon>:3:5
|
3 | 0;
| ^
error: aborting due to previous error
It would be nice if it said something like this:
rustc 1.17.0 (56124baa9 2017-04-24)
error: expected type, found `0`
--> <anon>:3:5
|
3 | 0;
| ^
error: aborting due to previous error
--> <anon>:2:21
|
2 | println!("test"):
| ^
hint: expecting a type because of type ascription here
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.