-
Notifications
You must be signed in to change notification settings - Fork 183
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
Remove RcStruct #1299
Remove RcStruct #1299
Conversation
994bd2c
to
bb0bb93
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
/// `dyn Drop` isn't legal (and doesn't make sense since `Drop` is not | ||
/// implement on all destructible types). However, all trait objects come with | ||
/// a destructor, so we can just use an empty trait to get a destructor object. | ||
pub trait ErasedDestructor: 'static {} |
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.
Thought: We're not actually using this in DataPayload, right? Because we are instead just Boxing the whole Yoke into a trait object? So we may or may not need this; if it doesn't solve our use case, is it going to solve anyone else's?
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.
Yes, I think that this is generally useful, it's just not useful for us anymore.
It may actually become useful in the future if we ever add e.g. RcRef
or something.
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.
We also can probably clean up the "Box the entire yoke into a trait object" business if we try, actually.
(finally)
Fixes #1262, fixes #1284
#1297 had all the churny parts of this change so this PR should be much more manageable (and can be reviewed at leisure).
This contains a bunch of related changes:
DataPayload::new_owned()
fromDataPayload::from_partial_owned()
ErasedCart
intoyoke
(Add Yoke::erase_cart() to Yoke #1284) and adding nice helper methods for working with it. We don't use it anymore, but it does seem generally useful.DataPayloadInner::RcStruct
andDataPayload::from_partial_owned()
It should be easy to re-add an
ErasedCart
basedRcRef(Yoke<&'static Y, ErasedRcCart>)
later if needed. It's worth waiting to see what our needs are in this area before adding new variants or constructors;Yoke
is pretty versatile so we should be able to use it as needed.