]> git.lizzy.rs Git - rust.git/commit
Auto merge of #75912 - scottmcm:manuallydrop-vs-forget, r=Mark-Simulacrum
authorbors <bors@rust-lang.org>
Wed, 26 Aug 2020 18:40:51 +0000 (18:40 +0000)
committerbors <bors@rust-lang.org>
Wed, 26 Aug 2020 18:40:51 +0000 (18:40 +0000)
commit48717b6f3ce661d2a0d64f7bdfdfb5fd3484ee5b
tree6132a4164c89982923e6303d7f39373f2ae46efa
parent1f2dd3b56aec4d8f97eb0b0552c166ef549d3316
parentf3024073f92b15d38b42241e65067f0ba796896c
Auto merge of #75912 - scottmcm:manuallydrop-vs-forget, r=Mark-Simulacrum

Suggest `mem::forget` if `mem::ManuallyDrop::new` isn't used

I think this communicates the intent more idiomatically, and is shorter anyway.

Inspired because [it came up on URLO](https://users.rust-lang.org/t/validity-of-memory-area-after-std-forget/47730/7?u=scottmcm), and it turns out that std had done it too in one spot:
![image](https://user-images.githubusercontent.com/18526288/91203819-e19f2980-e6f2-11ea-9112-835f3b22ce05.png)