about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-01 08:28:00 +0000
committerbors <bors@rust-lang.org>2024-09-01 08:28:00 +0000
commita81f1c8277a70a2b4f5d87926221ba5b37d4c3db (patch)
tree7d62ad100226e93813d796ce7124b570da557f71
parentac914d3457f968f4b79007ed912afbad189a162c (diff)
parent989ebae2ba5b79e259ee6267a390acd446cb5bff (diff)
downloadrust-a81f1c8277a70a2b4f5d87926221ba5b37d4c3db.tar.gz
rust-a81f1c8277a70a2b4f5d87926221ba5b37d4c3db.zip
Auto merge of #13325 - alex-semenyuk:wrong_self_convention_doc_fix, r=y21
Provide more clear example for `WRONG_SELF_CONVENTION`

Provide more clear example for `WRONG_SELF_CONVENTION`

changelog: none
-rw-r--r--clippy_lints/src/methods/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs
index d7126990edb..e1f1df4eecb 100644
--- a/clippy_lints/src/methods/mod.rs
+++ b/clippy_lints/src/methods/mod.rs
@@ -441,6 +441,17 @@ declare_clippy_lint! {
     ///     }
     /// }
     /// ```
+    ///
+    /// Use instead:
+    /// ```no_run
+    /// # struct X;
+    /// impl X {
+    ///     fn as_str(&self) -> &'static str {
+    ///         // ..
+    /// # ""
+    ///     }
+    /// }
+    /// ```
     #[clippy::version = "pre 1.29.0"]
     pub WRONG_SELF_CONVENTION,
     style,