(no title)
jaeh | 6 years ago
error: attempt to divide by zero
--> main.rs:2:16
|
2 | let result = 1 / 0;
| ^^^^^
|
= note: #[deny(const_err)] on by default
error: this expression will panic at runtime
--> main.rs:2:16
|
2 | let result = 1 / 0;
| ^^^^^ attempt to divide by zero
error: aborting due to 2 previous errors
very simple example though, no idea what happens when that value comes via socket or file, guess that would panic! then.
gpm|6 years ago
And yep, the result is a panic, even with debug_assertions off (i.e. you make overflows wrap instead of panic).
https://play.rust-lang.org/?version=stable&mode=release&edit...