Closed
Description
Given the following code (playground):
fn main() {
let a = [1, 2, 3].iter().sum();
let b = (a + 1) as usize;
}
The current output is:
error[E0282]: type annotations needed
--> src/main.rs:3:13
|
3 | let b = (a + 1) as usize;
| ^^^^^^^^^^^^^^^^ cannot infer type
|
= note: type must be known at this point
Ideally the output should look like:
error[E0282]: type annotations needed
--> src/main.rs:3:13
|
3 | let b = (a + 1) as usize;
| ^^^^^^^ cannot infer type
|
= note: type must be known at this point
Happens on both stable 1.52.1 and nightly 1.54.