rust/tests/ui/iterators/iterator-scope-collect-suggestion-81584.fixed
2025-08-17 13:01:02 -04:00

10 lines
331 B
Rust

// https://github.com/rust-lang/rust/issues/81584
//@ run-rustfix
fn main() {
let _ = vec![vec![0, 1], vec![2]]
.into_iter()
.map(|y| y.iter().map(|x| x + 1).collect::<Vec<_>>())
//~^ ERROR cannot return value referencing function parameter `y`
.collect::<Vec<_>>();
}