about summary refs log tree commit diff
path: root/src/test/ui/numbers-arithmetic/mod-zero.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/numbers-arithmetic/mod-zero.rs')
-rw-r--r--src/test/ui/numbers-arithmetic/mod-zero.rs7
1 files changed, 7 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 00000000000..a2798175d68
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/mod-zero.rs
@@ -0,0 +1,7 @@
+// run-fail
+// error-pattern:attempt to calculate the remainder with a divisor of zero
+#[allow(unconditional_panic)]
+fn main() {
+    let y = 0;
+    let _z = 1 % y;
+}