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

Can we use owning_ref to avoid some unsafe blocks? #2127

Closed
martinvonz opened this issue Aug 22, 2023 · 2 comments · Fixed by #2547
Closed

Can we use owning_ref to avoid some unsafe blocks? #2127

martinvonz opened this issue Aug 22, 2023 · 2 comments · Fixed by #2547

Comments

@martinvonz
Copy link
Member

In a review of unsafe code at Google, the suggestion to use owning_ref (https://docs.rs/owning_ref/latest/owning_ref/) came up. We should look into that.

@arxanas
Copy link
Contributor

arxanas commented Aug 22, 2023

owning_ref seems unsound and unmaintained: Kimundi/owning-ref-rs#77. There might be a maintained solution, or it might simply be possible (without having looked at the code) to shuttle around the value and its reference separately in an unergonomic way.

@yuja
Copy link
Contributor

yuja commented Aug 22, 2023

Mercurial recently switched to self_cell, and I think any of these can be used to remove unsafe from recursive tree iterators.
https://github.com/Voultapher/self_cell#related-projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants