]> git.lizzy.rs Git - rust.git/blobdiff - src/identity_op.rs
added wiki comments + wiki-generating python script
[rust.git] / src / identity_op.rs
index 7ed784f00fc49696a1f5f72828c911a3922ee964..88a03e050be087564114cc00b75084aad31ffc95 100644 (file)
@@ -6,6 +6,13 @@
 use consts::Constant::ConstantInt;
 use utils::{span_lint, snippet, in_macro};
 
+/// **What it does:** This lint checks for identity operations, e.g. `x + 0`. It is `Warn` by default.
+///
+/// **Why is this bad?** This code can be removed without changing the meaning. So it just obscures what's going on. Delete it mercilessly.
+///
+/// **Known problems:** None
+///
+/// **Example:** `x / 1 + 0 * 1 - 0 | 0`
 declare_lint! { pub IDENTITY_OP, Warn,
                 "using identity operations, e.g. `x + 0` or `y / 1`" }