]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/clippy_lints/src/return_self_not_must_use.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / tools / clippy / clippy_lints / src / return_self_not_must_use.rs
index 91e5e1e8b289288ae9c2e8d653f28484bfd8db36..60be6bd335f686eefc8befed49322c8d021ac983 100644 (file)
@@ -26,19 +26,20 @@ declare_clippy_lint! {
     /// if it was added on constructors for example.
     ///
     /// ### Example
-    /// Missing attribute
     /// ```rust
     /// pub struct Bar;
     /// impl Bar {
-    ///     // Bad
+    ///     // Missing attribute
     ///     pub fn bar(&self) -> Self {
     ///         Self
     ///     }
     /// }
     /// ```
     ///
-    /// It's better to have the `#[must_use]` attribute on the method like this:
+    /// Use instead:
     /// ```rust
+    /// # {
+    /// // It's better to have the `#[must_use]` attribute on the method like this:
     /// pub struct Bar;
     /// impl Bar {
     ///     #[must_use]
@@ -46,10 +47,10 @@ declare_clippy_lint! {
     ///         Self
     ///     }
     /// }
-    /// ```
+    /// # }
     ///
-    /// Or on the type definition like this:
-    /// ```rust
+    /// # {
+    /// // Or on the type definition like this:
     /// #[must_use]
     /// pub struct Bar;
     /// impl Bar {
@@ -57,6 +58,7 @@ declare_clippy_lint! {
     ///         Self
     ///     }
     /// }
+    /// # }
     /// ```
     #[clippy::version = "1.59.0"]
     pub RETURN_SELF_NOT_MUST_USE,