Switching from MinGW to MSVC resolved the issue for me.
You can check your active Rust toolchain by running:
rustup show active-toolchain
If the output includes gnu
at the end, you can switch to the MSVC toolchain with:
rustup default stable-x86_64-pc-windows-msvc