]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/erasing_op.rs
Auto merge of #3946 - rchaser53:issue-3920, r=flip1995
[rust.git] / clippy_lints / src / erasing_op.rs
index 247b3f678d83cb96035418f19642498d1b65b56a..07909ef587fee27bd0675563a688bb6828520bfe 100644 (file)
@@ -1,12 +1,13 @@
-use crate::consts::{constant_simple, Constant};
-use crate::utils::{in_macro, span_lint};
 use rustc::hir::*;
 use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
 use rustc::{declare_tool_lint, lint_array};
 use syntax::source_map::Span;
 
+use crate::consts::{constant_simple, Constant};
+use crate::utils::{in_macro, span_lint};
+
 declare_clippy_lint! {
-    /// **What it does:** Checks for erasing operations, e.g. `x * 0`.
+    /// **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
     /// **Known problems:** None.
     ///
     /// **Example:**
-    /// ```ignore
+    /// ```rust
+    /// let x = 1;
     /// 0 / x;
     /// 0 * x;
-    /// x & 0
+    /// x & 0;
     /// ```
     pub ERASING_OP,
     correctness,
-    "using erasing operations, e.g. `x * 0` or `y & 0`"
+    "using erasing operations, e.g., `x * 0` or `y & 0`"
 }
 
 #[derive(Copy, Clone)]