rust/tests/crashes/131342.rs
2024-10-09 15:34:45 +02:00

17 lines
343 B
Rust

//@ known-bug: #131342
// see also: 131342-2.rs
fn main() {
let mut items = vec![1, 2, 3, 4, 5].into_iter();
problem_thingy(&mut items);
}
fn problem_thingy(items: &mut impl Iterator<Item = u8>) {
let mut peeker = items.peekable();
match peeker.peek() {
Some(_) => (),
None => return (),
}
problem_thingy(&mut peeker);
}