Here is the important part of my code:
for i in 0..64 {
for j in 0..14 {
zobrist_pieces[i][j] = rng.random();
}
}
But when I ran it in Miri, this is what happened:
thread 'main' panicked at src\board.rs:44:17:
index out of bounds: the len is 15 but the index is 15
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
error: process didn't exit successfully: `C:\Users\saart\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\cargo-miri.exe runner target\miri\x86_64-pc-windows-msvc\debug\rustchessengine.exe` (exit code: 101)
As I had set 0..14 to be EXPLICITLY having 13 as the maximum indexed value, I am surprised.
Can anyone here please help me understand?