This is configurable, by default with optimizations on math overflow doesn't panic in rust, it wraps around.
Obviously the kernel won't enable panics here unless in debug mode.