mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 00:47:16 +00:00
Auto merge of #6019 - rail-rain:improve_known_probs_mut_key, r=flip1995
Improve the "known problems" section of `interior_mutable_key` * Remove the mention to `Rc` and `Arc` as these are `Freeze` (despite my intuition) so the lint correctly handles already. * Instead, explain what could cause a false positive, and mention `bytes` as an example. --- changelog: Improved the "known problems" section of `interior_mutable_key`
This commit is contained in:
commit
99374ae136
1 changed files with 4 additions and 2 deletions
|
@ -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 of the interior mutable types.
|
||||
/// However, this lint is unable to recognize this, so it causes a false positive in theses cases.
|
||||
/// The `bytes` crate is a great example of this.
|
||||
///
|
||||
/// **Example:**
|
||||
/// ```rust
|
||||
|
|
Loading…
Reference in a new issue