Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docs on Unsafety to Crate Root and README #16

Closed
lopopolo opened this issue Jul 26, 2019 · 0 comments · Fixed by #19
Closed

Add Docs on Unsafety to Crate Root and README #16

lopopolo opened this issue Jul 26, 2019 · 0 comments · Fixed by #19
Labels
A-unsafe-code Area: Unsafe code, be careful when reviewing. C-docs Category: Improvements or additions to documentation.

Comments

@lopopolo
Copy link
Member

The Rc implementation of Adoptable includes some docs on the safety implications of using these APIs incorrectly. This documentation should exist prominently in the crate root and the README

/// # Safety
///
/// Modifying the object graph by removing links after calling `adopt`
/// requires updating the bookkeeping with [`unadopt`](Adoptable::unadopt).
/// Failure to properly remove links from the object graph may cause `Drop`
/// to detect a cycle is not externally reachable, reulting in prematurely
/// deallocating the entire cycle and turning all reachable [`Rc`]s into
/// dangling pointers. `CactusRef` makes a best-effort attempt to abort the
/// program if an access to a dead `Rc` occurs.

lopopolo added a commit that referenced this issue Jul 27, 2019
@lopopolo lopopolo added A-unsafe-code Area: Unsafe code, be careful when reviewing. C-docs Category: Improvements or additions to documentation. labels Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-unsafe-code Area: Unsafe code, be careful when reviewing. C-docs Category: Improvements or additions to documentation.
Development

Successfully merging a pull request may close this issue.

1 participant