-
Notifications
You must be signed in to change notification settings - Fork 13.3k
generalize the Option<NonNullablePtr>
to libs
#8678
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
This seems like a pretty cool feature, but it's also a little worrying to me. Right now you can declare It does make sense to flag them with I'm not really sure what the best answer to that is. Arguably the only way to actually learn of the attributes would be to read about them in some documentation, so the best solution could be to just document them well. |
I think you could also use this on a multiple-word struct as long as the first word was always zero. Although, it's not explicitly supported yet because I don't know a use case. |
It seems like it would be relatively easy to pass the crate ctxt rather than the ty ctxt to give an error for size != 1 word. |
It would be equally unsafe with a check like that though. |
I vote making sure it's 1 word for now to be conservative. BTW, @nikomatsakis and I would like to remove the drop flag entirely, rendering this moot. |
Indeed. I am in fact actively working on this, though there is an annoyingly long set of blocker bugs in between here and there. |
But does that truly render the issue moot? It would still affect how much space |
I'm hearing that this patch will be subsumed by @nikomatsakis 's work-in-progress, so I'm closing the PR. Re-open if necessary. |
@catamorphism: I don't think it will - this is about making It does work but it could provide error messages on types that are not 1 word, instead of unspecified behaviour. |
Closing again due to lack of activity. Please do reopen if you're able to make progress, @thestinger ! |
I will eventually :). |
An
Option<Rc<T>>
is now 1-word, like the built-in non-nullable pointers.