about summary refs log tree commit diff
path: root/tests/ui/numbers-arithmetic/mod-zero.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/numbers-arithmetic/mod-zero.rs')
-rw-r--r--tests/ui/numbers-arithmetic/mod-zero.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/numbers-arithmetic/mod-zero.rs b/tests/ui/numbers-arithmetic/mod-zero.rs
new file mode 100644
index 00000000000..08371639412
--- /dev/null
+++ b/tests/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;
+}