Open
Description
The following code fails to compile, even though all types are known
https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=8de9e57e8de5cd8f2896f422d693f453
pub fn f(s: &str) {
let mut it = s.split(|c: char| c == ',').fuse();
let t = it.next().unwrap().parse::<usize>().unwrap();
}
Compiling playground v0.0.1 (/playground)
error[E0282]: type annotations needed
--> src/main.rs:3:13
|
3 | let t = it.next().unwrap().parse::<usize>().unwrap();
| ^^^^^^^^^^^^^^^^^^ cannot infer type for `T`
|
= note: type must be known at this point
error: aborting due to previous error
For more information about this error, try `rustc --explain E0282`.
error: Could not compile `playground`.
To learn more, run the command again with --verbose.