summaryrefslogtreecommitdiffstats
path: root/tests/ui/cast/issue-85586.rs
blob: 78816582b57f4cdbb88466c93fd939f2d801a786 (plain)
1
2
3
4
5
6
7
8
9
10
// 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]
}