You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In rustc 1.20.0-nightly (b2c0707 2017-07-13) gives the error message:
error[E0619]: the type of this value must be known in this context
--> ...\test.rs:2:5
|
2 | data.iter().sum().to_string()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The error message doesn't point to the exact location of the problem. The correct code is:
data.iter().sum::<u32>().to_string()
So probably I'd like an error message like:
error[E0619]: the type of this value must be known in this context
--> ...\test.rs:2:5
|
2 | data.iter().sum().to_string()
| ^^^^^
Even better: I'd like Rustc to infer the right type for sum(), not require a type hint there and compile the original code.
The text was updated successfully, but these errors were encountered:
This code:
In rustc 1.20.0-nightly (b2c0707 2017-07-13) gives the error message:
The error message doesn't point to the exact location of the problem. The correct code is:
data.iter().sum::<u32>().to_string()
So probably I'd like an error message like:
Even better: I'd like Rustc to infer the right type for sum(), not require a type hint there and compile the original code.
The text was updated successfully, but these errors were encountered: