summary refs log tree commit diff
path: root/src/test/ui/issues/issue-35668.rs
blob: 1b8ada57ed69c2c94ab6b8b5a0fa02feda77b7a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
fn func<'a, T>(a: &'a [T]) -> impl Iterator<Item=&'a T> {
    a.iter().map(|a| a*a)
    //~^ ERROR binary operation `*` cannot be applied to type `&T`
}

fn main() {
    let a = (0..30).collect::<Vec<_>>();

    for k in func(&a) {
        println!("{}", k);
    }
}