Skip to content

Commit f0ceb28

Browse files
committed
Auto merge of rust-lang#7065 - rail-rain:warn_copy_pass_by_ref, r=Manishearth
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.
2 parents a6b514c + fb54b70 commit f0ceb28

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

clippy_lints/src/pass_by_ref_or_value.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ declare_clippy_lint! {
4242
/// false positives in cases involving multiple lifetimes that are bounded by
4343
/// each other.
4444
///
45+
/// Also, it does not take account of other similar cases where getting memory addresses
46+
/// matters; namely, returning the pointer to the argument in question,
47+
/// and passing the argument, as both references and pointers,
48+
/// to a function that needs the memory address. For further details, refer to
49+
/// [this issue](https://github.com/rust-lang/rust-clippy/issues/5953)
50+
/// that explains a real case in which this false positive
51+
/// led to an **undefined behaviour** introduced with unsafe code.
52+
///
4553
/// **Example:**
4654
///
4755
/// ```rust

0 commit comments

Comments
 (0)