mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
11 lines
300 B
Rust
11 lines
300 B
Rust
|
// Check that errors for unresolved types in cast expressions are reported
|
||
|
// for the offending subexpression, not the whole cast expression.
|
||
|
|
||
|
#![allow(unused_variables)]
|
||
|
|
||
|
fn main() {
|
||
|
let a = [1, 2, 3].iter().sum();
|
||
|
let b = (a + 1) as usize;
|
||
|
//~^ ERROR: type annotations needed [E0282]
|
||
|
}
|