Auto merge of #7065 - rail-rain:warn_copy_pass_by_ref, r=Manishearth

Add a note on the issue #5953

Hello,

I thought it would be better to have a note and warning about this issue considering it introduced an UB in the past even with the "Search on Github" feature.

---

changelog: Add a note on the issue #5953 to the known problems section.
This commit is contained in:
bors 2021-04-12 04:38:42 +00:00
commit f0ceb28ba1

View File

@ -42,6 +42,14 @@ declare_clippy_lint! {
/// false positives in cases involving multiple lifetimes that are bounded by
/// each other.
///
/// Also, it does not take account of other similar cases where getting memory addresses
/// matters; namely, returning the pointer to the argument in question,
/// and passing the argument, as both references and pointers,
/// to a function that needs the memory address. For further details, refer to
/// [this issue](https://github.com/rust-lang/rust-clippy/issues/5953)
/// that explains a real case in which this false positive
/// led to an **undefined behaviour** introduced with unsafe code.
///
/// **Example:**
///
/// ```rust