Closed
Description
use std::convert::TryInto;
fn main() {
let _: usize = Some(0usize).map(|host: usize| 0usize).unwrap() + 0usize.try_into().unwrap();
}
Errors:
Compiling playground v0.0.1 (/playground)
error[E0284]: type annotations needed for `usize`
--> src/main.rs:4:38
|
4 | let _: usize = Some(0usize).map(|host: usize| 0usize).unwrap() + 0usize.try_into().unwrap();
| ^^^^ consider giving this closure parameter a type
|
= note: cannot resolve `<usize as std::ops::Add<_>>::Output == usize`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0284`.
error: could not compile `playground`.
To learn more, run the command again with --verbose.