diff options
| author | bors <bors@rust-lang.org> | 2020-07-20 01:36:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-07-20 01:36:21 +0000 |
| commit | 61e3d8a55c760a543659d270940c25c8180dc637 (patch) | |
| tree | 2ecef4170d2ab0f9ef3ad35393003f7b2124f9b3 /src/libstd/sys/unix/stack_overflow.rs | |
| parent | 942e0e6facd0944843441a4b8e004902487b6cb7 (diff) | |
| parent | a5cdd4aeb11fad6b0bf73d342398700a27c4484b (diff) | |
| download | rust-61e3d8a55c760a543659d270940c25c8180dc637.tar.gz rust-61e3d8a55c760a543659d270940c25c8180dc637.zip | |
Auto merge of #5824 - tmiasko:manually-drop-clone, r=Manishearth
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();
}
```
changelog: Ignore redundant clone lint for ManuallyDrop.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
