]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/clippy_lints/src/mut_reference.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / tools / clippy / clippy_lints / src / mut_reference.rs
index 9d8f8999ce409488a8c33f5c1c5a7dd0956a70a2..f434a655f8aff5a9d9c0fd101158b0ef02b1fc72 100644 (file)
@@ -16,12 +16,17 @@ declare_clippy_lint! {
     /// the value. Also the code misleads about the intent of the call site.
     ///
     /// ### Example
-    /// ```ignore
-    /// // Bad
-    /// my_vec.push(&mut value)
+    /// ```rust
+    /// # let mut vec = Vec::new();
+    /// # let mut value = 5;
+    /// vec.push(&mut value);
+    /// ```
     ///
-    /// // Good
-    /// my_vec.push(&value)
+    /// Use instead:
+    /// ```rust
+    /// # let mut vec = Vec::new();
+    /// # let value = 5;
+    /// vec.push(&value);
     /// ```
     #[clippy::version = "pre 1.29.0"]
     pub UNNECESSARY_MUT_PASSED,