about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2020-07-20 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2020-07-20 00:56:27 +0200
commita5cdd4aeb11fad6b0bf73d342398700a27c4484b (patch)
treee7c988d3b9b4ca6eb4f556a53134969f035d6f40 /src/libstd/sys/unix/stack_overflow.rs
parent8cf4219c1673533eb5caf304237bffaa8e847067 (diff)
downloadrust-a5cdd4aeb11fad6b0bf73d342398700a27c4484b.tar.gz
rust-a5cdd4aeb11fad6b0bf73d342398700a27c4484b.zip
Ignore not really redundant clones of ManuallyDrop
"Redundant" clones of `ManuallyDrop` are sometimes used for the side effect of
invoking the clone, without running the drop implementation of the inner type.
In other words, they aren't really redundant. For example, futures-rs crate:

```rust
#[allow(clippy::redundant_clone)] // The clone here isn't actually redundant.
unsafe fn increase_refcount<T: ArcWake>(data: *const ()) {
    // Retain Arc, but don't touch refcount by wrapping in ManuallyDrop
    let arc = mem::ManuallyDrop::new(Arc::<T>::from_raw(data as *const T));
    // Now increase refcount, but don't drop new refcount either
    let _arc_clone: mem::ManuallyDrop<_> = arc.clone();
}
```

Ignore redundant clone lint for ManuallyDrop.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions