rust-guide icon indicating copy to clipboard operation
rust-guide copied to clipboard

Raw pointer

Open ricked-twice opened this issue 4 years ago • 1 comments

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:

ricked-twice avatar Nov 20 '20 12:11 ricked-twice

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:

ricked-twice avatar May 20 '22 17:05 ricked-twice