Skip to content

Commit

Permalink
Auto merge of rust-lang#7065 - rail-rain:warn_copy_pass_by_ref, r=Man…
Browse files Browse the repository at this point in the history
…ishearth

Add a note on the issue rust-lang#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 rust-lang#5953 to the known problems section.
  • Loading branch information
bors committed Apr 12, 2021
2 parents a6b514c + fb54b70 commit f0ceb28
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions clippy_lints/src/pass_by_ref_or_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f0ceb28

Please sign in to comment.