Rollup merge of #97700 - nzrq:patch-1, r=dtolnay

Add note to documentation of HashSet::intersection

The functionality of the `std::collections::HashSet::intersection(...)` method was slightly surprising to me so I wanted to take a sec to contribute to the documentation for this method.

I've added a `Note:` section if that is appropriate.
This commit is contained in:
Matthias Krüger 2022-06-07 01:13:46 +02:00 committed by GitHub
commit c4bfd106e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -588,6 +588,12 @@ where
/// Visits the values representing the intersection,
/// i.e., the values that are both in `self` and `other`.
///
/// When an equal element is present in `self` and `other`
/// then the resulting `Intersection` may yield references to
/// one or the other. This can be relevant if `T` contains fields which
/// are not compared by its `Eq` implementation, and may hold different
/// value between the two equal copies of `T` in the two sets.
///
/// # Examples
///
/// ```