mirror of https://github.com/rust-lang/nomicon
`mem::forget` should usually not be used in unsafe code, as it's a little footgunny. `mem::forget` does a typed move _after_ the type has been moved out of, which is bad, as typed moves assert validity, but types can become invalid once they have been moved out of. In this specific example it's not a soundness problem, but we should promote the better style of using `ManuallyDrop<T>` instead.pull/381/head
parent
6956c60286
commit
eb351ec767
Loading…
Reference in new issue