rust-guide
rust-guide copied to clipboard
Raw pointer
During an internship studying Rust compilation phase, I encounter this problem with std::ptr::read
function.
As I read this guide, I thought I could contribute to it.
So this is a presentation of my contribution to this guide (english and french).
I extended the chapter 4 of the book, and added a rule about the usage of the std::ptr::read
function.
As explained, a usage with a type implementing the Drop
trait could lead to double-drop and possibly a double-free if the value is stored on the heap and freed during drop execution.
This kind of contribution should have followed an issue, but I have been told that it would be easier for maintainers to directly go for a pull request. So here it is! :smile:
Okay, so finally I should have took last reviews into account (with a lot of commits, sorry about that...). It only took me a year or so :+1: