Rc::ptr_eq should be unsafe because

โš“ Rust    ๐Ÿ“… 2025-07-30    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 12      

surdeus

Warning

This post was published 126 days ago. The information described in this article may have changed.

Letโ€™s say a Rc gets fully dropped: that means another Rc may take the same address, so a task that relies on ptr_eq may accidentally treat two different Rcs as pointing to the same.

Or, like JavaScript, Rc::ptr_eq also checks the identity hash so itโ€™s safe?

4 posts - 4 participants

Read full topic

๐Ÿท๏ธ Rust_feed