Closed
Description
I tried this code:
let data: [bool; 4] = [false, true, false, false];
let mut iter = data
.windows(1)
.enumerate()
.filter_map(|(i, _)| Some(i));
// THIS WILL CRASH ON X86
let _ = iter.next();
I expected to see this happen: it would not crash
Instead, this happened: it crashes
Meta
rustc 1.87.0 (17067e9ac 2025-05-09)
binary: rustc
commit-hash: 17067e9ac6d7ecb70e50f92c1944e545188d2359
commit-date: 2025-05-09
host: aarch64-apple-darwin
release: 1.87.0
LLVM version: 20.1.1
I have created a testbench https://github.com/bubblepipe/rust-nostd-x86-iter-crash/blob/main/qemu to replicate this crash.