-
Notifications
You must be signed in to change notification settings - Fork 13
Add an unsizing operation to {Arc,Rc}Box #71
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
Conversation
To avoid the unstable traits this uses a helper crate that provides the necessary checks and mechanisms for the raw pointer conversion while opting into them via a trait implemented for the smart pointers here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Honestly, unsize
would fit right in with the pointer-utils family. (I've been thinking of de-mono-repoing and putting these crates in an org, if you'd want to collaborate. Just a thought, not an ask. I'm still not even sure I want to set up an org.) I just have a couple nits and one thought:
thought: should the other crates support explicit unsizing? Specifically, {A}RcBorrow<T>
and Thin<Ptr<T>>
seem like good candidates. (The latter would need to make sure that the coerced-to pointer is also erasable.)
I'm happy to merge as-is once you've thought about those impls. Either way, they should probably be added in a followup PR anyway.
bors: d+
✌️ HeroicKatora can now approve this pull request. To approve and merge a pull request, simply reply with |
Oh, and I fixed the new warnings in #72, don't worry about them. |
bors r+ |
I'll see about a follow-up PR for those two crates, this sounds good to me as well. I wasn't sure about |
Build succeeded: |
Yeah, erase/unerase is always just be a pointer cast for sized types, so coercing from
all of which should be unlined. |
No description provided.