summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/erasing_op.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/src/docs/erasing_op.txt')
-rw-r--r--src/tools/clippy/src/docs/erasing_op.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/erasing_op.txt b/src/tools/clippy/src/docs/erasing_op.txt
new file mode 100644
index 000000000..3d285a6d8
--- /dev/null
+++ b/src/tools/clippy/src/docs/erasing_op.txt
@@ -0,0 +1,15 @@
+### What it does
+Checks for erasing operations, e.g., `x * 0`.
+
+### Why is this bad?
+The whole expression can be replaced by zero.
+This is most likely not the intended outcome and should probably be
+corrected
+
+### Example
+```
+let x = 1;
+0 / x;
+0 * x;
+x & 0;
+``` \ No newline at end of file