I'm writing a program that's quite compute heavy, and it's annoyingly slow to run in debug mode.
My program is also plagued by integer overflows, because I'm reading data from u8
arrays and u8
type spreads to unexpected places via type inference, and Rust prefers to overflow rather than to promote integers to larger types.
Building in release mode disables overflow checks:
cargo run --release
How can I build Rust executable with optimizations and runtime overflow checks enabled as well?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…