about summary refs log tree commit diff
diff options
context:
space:
mode:
authorrail <12975677+rail-rain@users.noreply.github.com>2020-09-09 14:18:19 +1200
committerrail <12975677+rail-rain@users.noreply.github.com>2020-09-09 14:18:19 +1200
commitd712d7f700977240ad9bd731fc3f76e05cc1c900 (patch)
tree027725ee4cf5c718b4ae0e24a7517974d00b6bae
parent8d6cf3a824852e59b98e2038bc574fce01108cf4 (diff)
downloadrust-d712d7f700977240ad9bd731fc3f76e05cc1c900.tar.gz
rust-d712d7f700977240ad9bd731fc3f76e05cc1c900.zip
Improve "known problems" of `interior_mutable_key`
* Remove the mention to `Rc` and `Arc` as these are `Freeze`
  so the lint correctly handles already.

* Instead, explain what could cause a false positive,
  and mention `bytes` as an example.
-rw-r--r--clippy_lints/src/mut_key.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/clippy_lints/src/mut_key.rs b/clippy_lints/src/mut_key.rs
index 7423107e8f9..fa3a99dad9d 100644
--- a/clippy_lints/src/mut_key.rs
+++ b/clippy_lints/src/mut_key.rs
@@ -12,8 +12,10 @@ declare_clippy_lint! {
     /// `BtreeSet` rely on either the hash or the order of keys be unchanging,
     /// so having types with interior mutability is a bad idea.
     ///
-    /// **Known problems:** We don't currently account for `Rc` or `Arc`, so
-    /// this may yield false positives.
+    /// **Known problems:** It's correct to use a struct, that contains interior mutability,
+    /// as a key; when its `Hash` implementation doesn't access any these interior mutable types.
+    /// However, this lint is unable to recognise it so cause a false positive.
+    /// `bytes` ctate is a great example of this.
     ///
     /// **Example:**
     /// ```rust