rust/tests/ui/numbers-arithmetic/mod-zero.rs

10 lines
190 B
Rust
Raw Normal View History

//@ run-fail
//@ error-pattern:attempt to calculate the remainder with a divisor of zero
//@ needs-subprocess
2020-05-07 15:39:02 +00:00
#[allow(unconditional_panic)]
fn main() {
2015-01-25 21:05:03 +00:00
let y = 0;
let _z = 1 % y;
}