diff options
Diffstat (limited to 'src/test/ui/numbers-arithmetic/mod-zero.rs')
-rw-r--r-- | src/test/ui/numbers-arithmetic/mod-zero.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/numbers-arithmetic/mod-zero.rs b/src/test/ui/numbers-arithmetic/mod-zero.rs new file mode 100644 index 000000000..083716394 --- /dev/null +++ b/src/test/ui/numbers-arithmetic/mod-zero.rs @@ -0,0 +1,9 @@ +// run-fail +// error-pattern:attempt to calculate the remainder with a divisor of zero +// ignore-emscripten no processes + +#[allow(unconditional_panic)] +fn main() { + let y = 0; + let _z = 1 % y; +} |