os-rust/src/test/ui/issues/issue-35668.rs

13 lines
244 B
Rust
Raw Normal View History

fn func<'a, T>(a: &'a [T]) -> impl Iterator<Item=&'a T> {
a.iter().map(|a| a*a)
2019-12-11 23:11:32 +01:00
//~^ ERROR cannot multiply `&T` to `&T`
}
fn main() {
let a = (0..30).collect::<Vec<_>>();
for k in func(&a) {
println!("{}", k);
}
}