mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
13 lines
244 B
Rust
13 lines
244 B
Rust
fn func<'a, T>(a: &'a [T]) -> impl Iterator<Item=&'a T> {
|
|
a.iter().map(|a| a*a)
|
|
//~^ ERROR cannot multiply `&T` by `&T`
|
|
}
|
|
|
|
fn main() {
|
|
let a = (0..30).collect::<Vec<_>>();
|
|
|
|
for k in func(&a) {
|
|
println!("{}", k);
|
|
}
|
|
}
|